Changeset ad5c62f


Ignore:
Timestamp:
04/13/10 16:20:00 (12 years ago)
Author:
kirilma <kirilma@…>
Branches:
master, qt5
Children:
47d0a31
Parents:
22232d9
Message:

move Settings and About to Window Menu

  • remove Setting and About controls from widgets
  • make instead a window menus with the corresponding actions
  • rename "Proxy settings" to "Settings", placing the proxy button in a control group
Location:
src/gui
Files:
7 edited
3 moved

Legend:

Unmodified
Added
Removed
  • src/gui/gui.pro

    r22232d9 rad5c62f  
    4646    tabcontainer.ui \
    4747    mapwindow.ui \
    48     proxysettingsdialog.ui
     48    settingsdialog.ui
    4949
    5050HEADERS += roomstabcontainer.h \
     
    6464    tabcontainer.h \
    6565    mapwindow.h \
    66     proxysettingsdialog.h
     66    settingsdialog.h
    6767
    6868SOURCES += roomstabcontainer.cpp \
     
    8282    tabcontainer.cpp \
    8383    mapwindow.cpp \
    84     proxysettingsdialog.cpp
     84    settingsdialog.cpp
    8585
    8686#maemo {
  • src/gui/importschedulewidget.cpp

    r22232d9 rad5c62f  
    2020
    2121#include <schedulexmlparser.h>
    22 #include "proxysettingsdialog.h"
    2322
    2423#include <QDir>
     
    5251    connect(online, SIGNAL(clicked()), SLOT(downloadSchedule()));
    5352
    54     connect(proxySettings, SIGNAL(clicked()), SLOT(setupProxy()));
    5553    mNetworkAccessManager = new QNetworkAccessManager(this);
    5654    connect(mNetworkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkQueryFinished(QNetworkReply*)));
     
    119117    QNetworkRequest request;
    120118    request.setUrl(QUrl(SCHEDULE_URL));
     119
     120    mNetworkAccessManager->setProxy(QNetworkProxy::applicationProxy());
    121121    mNetworkAccessManager->get(request);
    122122}
     
    127127    online->hide();
    128128    progressBar->show();
    129     proxySettings->hide();
     129    // proxySettings->hide();
    130130
    131131    int confId = mXmlParser->parseData(aData);
     
    134134    browse->show();
    135135    online->show();
    136     proxySettings->show();
     136    // proxySettings->show();
    137137    importScheduleLabel->setText("Import schedule: ");
    138138
     
    140140}
    141141
    142 void ImportScheduleWidget::setupProxy()
    143 {
    144     ProxySettingsDialog dialog;
    145     dialog.exec();
    146 
    147     qDebug() << "Setting-up proxy: " << AppSettings::proxyAddress() << ":" << AppSettings::proxyPort();
    148     QNetworkProxy proxy(
    149             AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : QNetworkProxy::HttpProxy,
    150             AppSettings::proxyAddress(),
    151             AppSettings::proxyPort(),
    152             PROXY_USERNAME,
    153             PROXY_PASSWD);
    154     QNetworkProxy::setApplicationProxy(proxy);
    155 
    156     mNetworkAccessManager->setProxy(QNetworkProxy::applicationProxy());
    157 }
    158 
  • src/gui/importschedulewidget.h

    r22232d9 rad5c62f  
    3939        void networkQueryFinished(QNetworkReply *aReply);
    4040        void downloadSchedule();
    41         void setupProxy();
    4241    signals:
    4342        void scheduleImported(int confId);
  • src/gui/importschedulewidget.ui

    r22232d9 rad5c62f  
    6969     </item>
    7070     <item>
    71       <widget class="QToolButton" name="proxySettings" >
    72        <property name="text" >
    73         <string>...</string>
    74        </property>
    75        <property name="icon" >
    76         <iconset resource="../icons.qrc" >
    77          <normaloff>:/icons/settings.png</normaloff>:/icons/settings.png</iconset>
    78        </property>
    79        <property name="autoRaise" >
    80         <bool>true</bool>
    81        </property>
    82       </widget>
    83      </item>
    84      <item>
    85       <widget class="QPushButton" name="browse" >
    86        <property name="sizePolicy" >
    87         <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
     71      <widget class="QPushButton" name="browse">
     72       <property name="sizePolicy">
     73        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
    8874         <horstretch>0</horstretch>
    8975         <verstretch>0</verstretch>
  • src/gui/mainwindow.cpp

    r22232d9 rad5c62f  
    3838#include "importschedulewidget.h"
    3939#include "mapwindow.h"
     40#include "settingsdialog.h"
    4041
    4142#include <tabcontainer.h>
     
    8687    connect(showMapButton, SIGNAL(clicked()), SLOT(conferenceMapClicked()));
    8788
    88     connect(tabWidget, SIGNAL(infoIconClicked()), SLOT(aboutApp()));
     89    connect(aboutAction, SIGNAL(triggered()), SLOT(aboutApp()));
     90    connect(settingsAction, SIGNAL(triggered()), SLOT(setup()));
    8991
    9092    selectConference->setDuplicatesEnabled(false);
     
    232234}
    233235
     236void MainWindow::setup()
     237{
     238    SettingsDialog dialog;
     239    dialog.exec();
     240
     241    qDebug() << "Setting-up proxy: " << AppSettings::proxyAddress() << ":" << AppSettings::proxyPort();
     242    QNetworkProxy proxy(
     243            AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : QNetworkProxy::HttpProxy,
     244            AppSettings::proxyAddress(),
     245            AppSettings::proxyPort(),
     246            PROXY_USERNAME,
     247            PROXY_PASSWD);
     248    QNetworkProxy::setApplicationProxy(proxy);
     249}
  • src/gui/mainwindow.h

    r22232d9 rad5c62f  
    3838    void eventHasChanged(int aEventId, bool aReloadModel);
    3939    void conferenceChanged(int aIndex);
     40    void setup();
    4041private:
    4142    void fillAndShowConferenceHeader();
  • src/gui/mainwindow.ui

    r22232d9 rad5c62f  
    2222   <layout class="QGridLayout" name="gridLayout" >
    2323    <item row="0" column="0" >
    24      <widget class="TabWidget" name="tabWidget" >
     24     <widget class="QTabWidget" name="tabWidget" >
    2525      <property name="currentIndex" >
    2626       <number>2</number>
     
    306306  </widget>
    307307  <widget class="QStatusBar" name="statusbar" />
     308  <widget class="QMenuBar" name="menuBar">
     309   <property name="geometry">
     310    <rect>
     311     <x>0</x>
     312     <y>0</y>
     313     <width>903</width>
     314     <height>25</height>
     315    </rect>
     316   </property>
     317   <widget class="QMenu" name="menuMenu">
     318    <property name="title">
     319     <string>Menu</string>
     320    </property>
     321    <addaction name="settingsAction"/>
     322    <addaction name="aboutAction"/>
     323   </widget>
     324   <addaction name="menuMenu"/>
     325  </widget>
     326  <action name="actionSettings">
     327   <property name="text">
     328    <string>Settings</string>
     329   </property>
     330  </action>
     331  <action name="settingsAction">
     332   <property name="icon">
     333    <iconset resource="../icons.qrc">
     334     <normaloff>:/icons/settings.png</normaloff>:/icons/settings.png</iconset>
     335   </property>
     336   <property name="text">
     337    <string>Settings</string>
     338   </property>
     339  </action>
     340  <action name="aboutAction">
     341   <property name="icon">
     342    <iconset resource="../icons.qrc">
     343     <normaloff>:/icons/info.png</normaloff>:/icons/info.png</iconset>
     344   </property>
     345   <property name="text">
     346    <string>About</string>
     347   </property>
     348  </action>
    308349 </widget>
    309350 <customwidgets>
    310   <customwidget>
    311    <class>TabWidget</class>
    312    <extends>QTabWidget</extends>
    313    <header>tabwidget.h</header>
    314    <container>1</container>
    315   </customwidget>
    316351  <customwidget>
    317352   <class>ImportScheduleWidget</class>
  • src/gui/settingsdialog.cpp

    r22232d9 rad5c62f  
    1717 * fosdem-schedule.  If not, see <http://www.gnu.org/licenses/>.
    1818 */
    19 #include "proxysettingsdialog.h"
     19#include "settingsdialog.h"
    2020
    2121#include <appsettings.h>
    2222#include <QDebug>
    2323
    24 ProxySettingsDialog::ProxySettingsDialog(QWidget *aParent)
     24SettingsDialog::SettingsDialog(QWidget *aParent)
    2525    : QDialog(aParent)
    2626{
     
    3939}
    4040
    41 void ProxySettingsDialog::connectionTypeChanged(bool aState)
     41void SettingsDialog::connectionTypeChanged(bool aState)
    4242{
    4343    aState ? proxyWidget->hide() : proxyWidget->show();
    4444}
    4545
    46 void ProxySettingsDialog::saveDialogData()
     46void SettingsDialog::saveDialogData()
    4747{
    4848    // serialize dialog data
  • src/gui/settingsdialog.h

    r22232d9 rad5c62f  
    1717 * fosdem-schedule.  If not, see <http://www.gnu.org/licenses/>.
    1818 */
    19 #ifndef PROXYSETTINGSDIALOG_H
    20 #define PROXYSETTINGSDIALOG_H
     19#ifndef SETTINGSDIALOG_H
     20#define SETTINGSDIALOG_H
    2121
    2222#include <QDialog>
    23 #include "ui_proxysettingsdialog.h"
     23#include "ui_settingsdialog.h"
    2424
    25 class ProxySettingsDialog : public QDialog, Ui::ProxySettingsDialog
     25class SettingsDialog : public QDialog, Ui::SettingsDialog
    2626{
    2727    Q_OBJECT
    2828public:
    29     ProxySettingsDialog(QWidget *aParent = NULL);
    30     ~ProxySettingsDialog() {}
     29    SettingsDialog(QWidget *aParent = NULL);
     30    ~SettingsDialog() {}
    3131private slots:
    3232    void connectionTypeChanged(bool aState);
  • src/gui/settingsdialog.ui

    r22232d9 rad5c62f  
    11<ui version="4.0" >
    2  <class>ProxySettingsDialog</class>
    3  <widget class="QDialog" name="ProxySettingsDialog" >
     2 <class>SettingsDialog</class>
     3 <widget class="QDialog" name="SettingsDialog" >
    44  <property name="geometry" >
    55   <rect>
     
    1717  </property>
    1818  <property name="windowTitle" >
    19    <string>Proxy settings</string>
     19   <string>Settings</string>
    2020  </property>
    2121  <layout class="QVBoxLayout" name="verticalLayout" >
    2222   <item>
     23    <widget class="QGroupBox" name="groupBox">
     24     <property name="title">
     25      <string>Proxy Settings</string>
     26     </property>
     27     <layout class="QVBoxLayout" name="verticalLayout_2">
     28      <item>
    2329    <widget class="QCheckBox" name="directConnection" >
    2430     <property name="text" >
     
    7177      <size>
    7278       <width>20</width>
    73        <height>10</height>
     79          <height>24</height>
    7480      </size>
    7581     </property>
     
    102108  </layout>
    103109 </widget>
     110   </item>
     111  </layout>
     112 </widget>
    104113 <resources/>
    105114 <connections/>
Note: See TracChangeset for help on using the changeset viewer.