Skip to content
This repository has been archived by the owner on Aug 26, 2020. It is now read-only.

Commit

Permalink
- Add Always On Top for Windows users.
Browse files Browse the repository at this point in the history
- Misc fixes for disabling/enabling pilots.
  • Loading branch information
3vi1 committed Apr 1, 2017
1 parent 523e19d commit 686bfb9
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 25 deletions.
13 changes: 0 additions & 13 deletions docs/FAQ
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,13 @@ A: That's because I never tested other regions. I'm a madman like that. I've

---------------------------------------------------------------------------------------------

Q: Where's the "Always on Top" option?

A: That's a feature that should be part of your window manager, rather than re-implemented
in every app's UI. On Linux, right-click the title bar and click "Always on Top". On
Windows, there are some third-party apps that will allow you set the flag for any app.

Nothing's off the table though. I might even add a feature I don't believe is needed
if Isk is thrown at Khasm Kaotiqa. :)

---------------------------------------------------------------------------------------------

Q: Where are the transparency options?

A: That's a feature that should be part of your desktop compositor, rather than
re-implemented in every app's UI. On Linux, the Compiz, KWin, and other compositors
give you options to do this for each app. On Windows, I know there are some third-
party apps that allow you to do it.

Again... nothing's off the table. :)

---------------------------------------------------------------------------------------------

Q: Where's the tray icon?
Expand Down
2 changes: 2 additions & 0 deletions docs/RELEASES
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
options dialog, so you do not need to restart IMP to see newly added
files.

Windows users will now see a "Window" menu, which has the "Always on
Top" option that's missing from their desktop compositor.

0.7.7 - Catches network/server failures on KOS lookups and plays a new "incomplete"
lookup sound. The new sound is configurable on KOS tab in options, and
Expand Down
27 changes: 26 additions & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ MainWindow::MainWindow(QWidget *parent) :

ui->setupUi(this);

#ifndef Q_OS_WIN32
ui->menu_Window->menuAction()->setVisible(false);
#endif


// Initialize lastAlertTime
lastAlertTime = QDateTime::currentDateTimeUtc().addDays(-1);

Expand Down Expand Up @@ -662,7 +667,7 @@ void MainWindow::gotRegionFile()
connect(regionMap, &Map::newPilot,
this, &MainWindow::gotNewPilot);
connect(regionMap, &Map::pilotLocationChange,
ui->mapView, &SvgMapView::gotPilotLocation);
this, &MainWindow::onPilotLocation);
connect(regionMap, &Map::systemColorUpdated,
ui->mapView, &SvgMapView::gotSystemColor);
connect(regionMap, &Map::systemTimeUpdated,
Expand All @@ -680,6 +685,11 @@ void MainWindow::gotRegionFile()
regionMap->startUpdates();
}

void MainWindow::onPilotLocation(const QString &pilotName, const QString &systemName)
{
ui->mapView->gotPilotLocation(pilotName, systemName, pilotIsEnabled(pilotName));
}

void MainWindow::failedGettingBridgeFile(QNetworkReply::NetworkError err)
{
qDebug() << "MainWindow::failedGettingBridgeFile - Failed to retrieve bridge file.";
Expand Down Expand Up @@ -1525,3 +1535,18 @@ void MainWindow::on_actionReset_Rotation_triggered()
{
ui->mapView->resetRotation();
}

void MainWindow::on_action_Always_on_Top_triggered(bool checked)
{
Qt::WindowFlags flags = this->windowFlags();
if (checked)
{
this->setWindowFlags(flags | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint);
this->show();
}
else
{
this->setWindowFlags(flags ^ (Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint));
this->show();
}
}
3 changes: 2 additions & 1 deletion src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private slots:
void pilotSelected();
void themeSelected();
void updatePosition();
void onPilotLocation(const QString &pilotName, const QString &systemName);
void on_actionAbout_triggered();
void on_actionOptions_triggered();
void on_actionF_YH5B_triggered();
Expand All @@ -99,8 +100,8 @@ private slots:
void on_actionSave_As_Theme_triggered();
void on_actionFindMessages_triggered();
void on_actionCustomize_triggered();

void on_actionReset_Rotation_triggered();
void on_action_Always_on_Top_triggered(bool checked);

private:
void initParsing();
Expand Down
17 changes: 16 additions & 1 deletion src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
<x>0</x>
<y>0</y>
<width>1024</width>
<height>25</height>
<height>19</height>
</rect>
</property>
<property name="font">
Expand Down Expand Up @@ -203,12 +203,19 @@
<string>Pilots</string>
</property>
</widget>
<widget class="QMenu" name="menu_Window">
<property name="title">
<string>&amp;Window</string>
</property>
<addaction name="action_Always_on_Top"/>
</widget>
<addaction name="menuDebug"/>
<addaction name="menuPilots"/>
<addaction name="menuFind"/>
<addaction name="menuRegion"/>
<addaction name="menuOptions"/>
<addaction name="menuTheme"/>
<addaction name="menu_Window"/>
<addaction name="menuHelp"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
Expand Down Expand Up @@ -394,6 +401,14 @@
<string>&amp;Reset Rotation</string>
</property>
</action>
<action name="action_Always_on_Top">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Always on Top</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
Expand Down
2 changes: 1 addition & 1 deletion src/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static const struct Version
{
Version(){}

QString release = VERSION;
QString release = "0.7.8"; //VERSION;
QString name = "Still Some Sort of Lycanthropic Hot Topic";

QString styleHeader1 = "<span style=\" color:#0000ff;\">";
Expand Down
6 changes: 4 additions & 2 deletions src/svgmapview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ void SvgMapView::findLocation(const QString &systemName)
}
}

void SvgMapView::gotPilotLocation(const QString& pilotName, const QString& systemName)
void SvgMapView::gotPilotLocation(const QString& pilotName, const QString& systemName, bool enabled)
{
if(!m_map->contains(systemName))
{
Expand Down Expand Up @@ -407,7 +407,9 @@ void SvgMapView::gotPilotLocation(const QString& pilotName, const QString& syste
}

pilotShapes.insert(pilotName, pilotShape);
mapScene.addItem(pilotShape);

if(enabled)
mapScene.addItem(pilotShape);
}

pilotShape->setPos(m_map->getCoordinates(systemName));
Expand Down
7 changes: 1 addition & 6 deletions src/svgmapview.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,7 @@ public slots:
void gotSystemTime(const QString& name, const QString& text, QColor timeColor);
void gotSystemColor(const QString& name, QColor color);

// Theme Changes
//void gotBackColor(const QColor& c);
//void gotLineColor(const QColor& c);

void gotPilotLocation(const QString &pilotName, const QString &systemName);

void gotPilotLocation(const QString &pilotName, const QString &systemName, bool enabled = true);
void gotSystemShapesFile(QString shapesFile);

void receiveThemeUpdate(ThemeStorage &a);
Expand Down

0 comments on commit 686bfb9

Please sign in to comment.