Skip to content

Commit

Permalink
removed application icon support in update window
Browse files Browse the repository at this point in the history
  • Loading branch information
pypt committed Jun 1, 2012
1 parent 629a3ed commit 06a5325
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 50 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ fvupdateconfig.h

# Qt
*.pro.user
*.ui.autosave
*.qm
Sample-build-*
6 changes: 5 additions & 1 deletion fvupdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,14 @@ void FvUpdater::hideUpdateConfirmationDialog()
}
}

void FvUpdater::SetFeedURL(QUrl feedURL)
{
m_feedURL = feedURL;
}

void FvUpdater::SetFeedURL(QString feedURL)
{
m_feedURL = QUrl(feedURL);
SetFeedURL(QUrl(feedURL));
}

QString FvUpdater::GetFeedURL()
Expand Down
5 changes: 3 additions & 2 deletions fvupdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class FvUpdater : public QObject
static FvUpdater* sharedUpdater();
static void drop();

// Set feed URL
// Set / get feed URL
void SetFeedURL(QUrl feedURL);
void SetFeedURL(QString feedURL);
QString GetFeedURL();

Expand Down Expand Up @@ -97,7 +98,7 @@ protected slots:
//
// HTTP feed fetcher infrastructure
//
QUrl m_feedURL; // Feed URL that is currently being fetched
QUrl m_feedURL; // Feed URL that will be fetched
QNetworkAccessManager m_qnam;
QNetworkReply* m_reply;
int m_httpGetId;
Expand Down
9 changes: 2 additions & 7 deletions fvupdatewindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#include "fvupdater.h"
#include "fvavailableupdate.h"
#include <QApplication>
#include <QIcon>
#include <QGraphicsScene>
#include <QDebug>


Expand All @@ -14,14 +12,11 @@ FvUpdateWindow::FvUpdateWindow(QWidget *parent) :
{
m_ui->setupUi(this);

m_appIconScene = 0;

// Delete on close
setAttribute(Qt::WA_DeleteOnClose, true);

// Set application icon
QIcon appIcon = QApplication::windowIcon();
QGraphicsScene appIconScene;
appIconScene.addPixmap(appIcon.pixmap(m_ui->appIconGraphicsView->size()));

// Set the "new version is available" string
QString newVersString = m_ui->newVersionIsAvailableLabel->text().arg(QApplication::applicationName());
m_ui->newVersionIsAvailableLabel->setText(newVersString);
Expand Down
2 changes: 2 additions & 0 deletions fvupdatewindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define FVUPDATEWINDOW_H

#include <QWidget>
class QGraphicsScene;

namespace Ui {
class FvUpdateWindow;
Expand All @@ -20,6 +21,7 @@ class FvUpdateWindow : public QWidget

private:
Ui::FvUpdateWindow* m_ui;
QGraphicsScene* m_appIconScene;

};

Expand Down
29 changes: 2 additions & 27 deletions fvupdatewindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>615</width>
<height>329</height>
<width>640</width>
<height>320</height>
</rect>
</property>
<property name="windowTitle">
<string>Software Update</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QGraphicsView" name="appIconGraphicsView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="interactive">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
Expand Down
28 changes: 15 additions & 13 deletions sample/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QPushButton" name="updateButton">
<property name="geometry">
<rect>
<x>140</x>
<y>110</y>
<width>114</width>
<height>32</height>
</rect>
</property>
<property name="text">
<string>Updates</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="updateButton">
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Check for updates</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
Expand Down

0 comments on commit 06a5325

Please sign in to comment.