Commit 3a3d432f authored by Alf Gaida's avatar Alf Gaida

Cherry-picking upstream version 15.08.16.

Fixed fugly icon, https://github.com/andrew-bibb/cmst/issues/107
parent c3fe7934
......@@ -10,6 +10,15 @@ assist in obtaining the information from you necessary to logon the wifi service
The program requires that connman be installed and running. The program depends on QT5, but only the base package.
The [Wiki](https://github.com/andrew-bibb/cmst/wiki) has been started and announcements, news and other information can be found there.
The [Wiki](https://github.com/andrew-bibb/cmst/wiki) has been started and announcements, news, and other information can be found there.
[Screen shots:](https://github.com/andrew-bibb/cmst/wiki/Screenshots) are now included in the Wiki
There is a PKGBUILD for this project in the Arch Linux AUR.
If you are not on Arch download the release and extract the files. Then run:
qmake
make
make install (as root)
# We need the qt libraries, we want compiler warnings off, and this is a release version of the program
# We need the qt libraries, we want compiler warnings on, and this is a release version of the program
CONFIG += qt
CONFIG +=warn_off
CONFIG +=release
CONFIG +=nostrip
CONFIG += warn_on
CONFIG += release
CONFIG += nostrip
# Widgets needed for QT5,
QT += widgets
QT += dbus
QT += network
QT += core
# cmst variables
include(../../cmst.pri)
......@@ -52,6 +53,7 @@ HEADERS += ./code/notify/notify.h
HEADERS += ./code/peditor/peditor.h
HEADERS += ./code/provisioning/prov_ed.h
HEADERS += ./code/trstring/tr_strings.h
HEADERS += ./code/iconman/iconman.h
# forms
FORMS += ./code/control_box/ui/controlbox.ui
......@@ -71,6 +73,7 @@ SOURCES += ./code/notify/notify.cpp
SOURCES += ./code/peditor/peditor.cpp
SOURCES += ./code/provisioning/prov_ed.cpp
SOURCES += ./code/trstring/tr_strings.cpp
SOURCES += ./code/iconman/iconman.cpp
# resource files
RESOURCES += ../../cmst.qrc
......
......@@ -156,7 +156,7 @@ void ConnmanAgent::createInputMap(const QMap<QString,QVariant>& r_map)
if (! i.value().canConvert<QDBusArgument>() ) return;
const QDBusArgument qdba = i.value().value<QDBusArgument>();
if ( ! qdba.currentType() == QDBusArgument::MapType ) {
if (qdba.currentType() != QDBusArgument::MapType ) {
if (b_loginputrequest) log << "Error - QDBusArgument as the value is not a MapType\n";
return;
}
......
......@@ -46,9 +46,7 @@ class ConnmanAgent : public QObject, protected QDBusContext
Q_CLASSINFO("D-Bus Interface", "net.connman.Agent")
public:
ConnmanAgent(QObject*);
inline void setLogInputRequest(bool b) {b_loginputrequest = b;}
ConnmanAgent(QObject*);
public Q_SLOTS:
void Release();
......@@ -66,6 +64,9 @@ class ConnmanAgent : public QObject, protected QDBusContext
public:
inline void setWhatsThisIcon(QIcon icon) {uiDialog->setWhatsThisIcon(icon);}
inline void setLogInputRequest(bool b) {b_loginputrequest = b;}
inline QString getBrowser() {return uiDialog->getBrowser();}
inline void setBrowser(const QString& b) {uiDialog->setBrowser(b);}
};
#endif
......@@ -31,10 +31,11 @@ DEALINGS IN THE SOFTWARE.
# include <QtCore/QDebug>
# include <QList>
# include <QWhatsThis>
# include <QProcess>.
# include <QProcess>
# include <QProcessEnvironment>
# include <QDir>
# include <QMessageBox>
# include <QStringListModel>
# include "./agent_dialog.h"
# include "./code/trstring/tr_strings.h"
......@@ -45,12 +46,21 @@ AgentDialog::AgentDialog(QWidget* parent)
// setup the user interface
ui.setupUi(this);
// data members
cli_browsers.clear();
cli_browsers << "lynx" << "w3m" << "links" << "elinks";
gui_browsers.clear();
gui_browsers << "google-chrome" << "google-chrome-unstable" << "chromium" << "opera"; // blink based
gui_browsers << "firefox" << "seamonkey"; // gecko based
gui_browsers << "qupzilla" << "luakit" << "dwb" << "jumanji" << "midoir" << "surf" << "vimprobable"; // webkit based
gui_browsers << "konqueror" << "dillo" << "xdg-open"; // other
// connect signals to slots
connect(ui.toolButton_whatsthis, SIGNAL(clicked()), this, SLOT(showWhatsThis()));
connect (ui.checkBox_hide_passphrase, SIGNAL(clicked(bool)), this, SLOT(hidePassphrase(bool)));
connect (ui.checkBox_wps_no_pin, SIGNAL(clicked(bool)), this, SLOT(useWPSPushButton(bool)));
connect (ui.radioButton_other, SIGNAL(toggled(bool)), this, SLOT(useOtherBrowser(bool)));
connect (ui.pushButton_launch_browser,SIGNAL(clicked()), this, SLOT(launchBrowser()));
connect (ui.lineEdit_browser, SIGNAL(textEdited(const QString&)), this, SLOT(enteringBrowser(const QString&)));
// find the PATH of the current environment
sys_env_path = QString();
......@@ -127,8 +137,8 @@ int AgentDialog::showPage1(const QString& url)
QStringList sl_browsers;
if (! sys_env_path.isEmpty() ) {
QStringList sl_loop = sys_env_path.split(':');
QStringList sl_targets;
sl_targets << "firefox" << "opera" << "luakit" << "lynx";
QStringList sl_targets = cli_browsers;
sl_targets.append(gui_browsers);
sl_browsers.clear();
for (int i = 0; i < sl_loop.size(); ++i) {
QDir dir = QDir(sl_loop.at(i));
......@@ -136,13 +146,10 @@ int AgentDialog::showPage1(const QString& url)
} // for dir in path
} // if path not empty
// enable the radioButtons where we can find a browser on this system
// if path is empty all are enabled
if (sl_browsers.contains("firefox")) ui.radioButton_firefox->setEnabled(true);
if (sl_browsers.contains("opera")) ui.radioButton_opera->setEnabled(true);
if (sl_browsers.contains("luakit")) ui.radioButton_luakit->setEnabled(true);
if (sl_browsers.contains("lynx")) ui.radioButton_lynx->setEnabled(true);
ui.radioButton_other->setEnabled(true);
// add found browsers to the listView
ui.listView_browsers->setModel(new QStringListModel(sl_browsers));
connect (ui.listView_browsers->selectionModel(), SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), this, SLOT(updateBrowserChoice(const QModelIndex&, const QModelIndex&)));
ui.listView_browsers->setEnabled(true);
this->ui.stackedWidget->setCurrentIndex(1);
return this->exec();
......@@ -198,13 +205,7 @@ void AgentDialog::initialize()
list.append(ui.lineEdit_eap_identity);
list.append(ui.lineEdit_wps_pin);
list.append(ui.checkBox_wps_no_pin);
list.append(ui.radioButton_firefox);
list.append(ui.radioButton_opera);
list.append(ui.radioButton_luakit);
list.append(ui.radioButton_lynx);
list.append(ui.radioButton_other);
list.append(ui.lineEdit_other_browser);
list.append(ui.listView_browsers);
// set disabled true for all widgets in the list and clear contents
for (int i = 0; i < list.size(); ++i) {
......@@ -240,19 +241,20 @@ void AgentDialog::showWhatsThis()
}
//
// Slot to control activation of the lineedit to allow typing in a browser name
// Called when ui.radioButton_other is checked or unchecked
void AgentDialog::useOtherBrowser(bool b_checked)
// Slot to set browser as the chosen item in the list
// Called when ui.listView_browsers selectionChanged() signal is emitted
//
void AgentDialog::updateBrowserChoice(const QModelIndex & current, const QModelIndex & previous)
{
// enable text entry box if checked
if (b_checked) ui.lineEdit_other_browser->setEnabled(true);
// otherwise disable
else ui.lineEdit_other_browser->setEnabled(false);
return;
ui.lineEdit_browser->setText(current.data().toString());
}
//
// Slot to clear selection in the browser list view
// Called when ui.lineEdit_browser textEdited() signal is emitted
void AgentDialog::enteringBrowser(const QString&)
{
ui.listView_browsers->selectionModel()->clearSelection();
}
//
// Slot to launch the selected browser
// Called when ui.pushButton_launch_browser is pressed
......@@ -273,17 +275,18 @@ void AgentDialog::launchBrowser()
} // for dir in path
} // if path not empty
if (ui.radioButton_firefox->isChecked()) process->startDetached(QString("firefox"), QStringList(ui.lineEdit_url->text()) );
if (ui.radioButton_opera->isChecked()) process->startDetached(QString("opera"), QStringList(ui.lineEdit_url->text()) );
if (ui.radioButton_luakit->isChecked()) process->startDetached(QString("luakit"), QStringList(ui.lineEdit_url->text()) );
if (ui.radioButton_lynx->isChecked()) {
// Code below assumes that every browser will take a URL as an argument
QString chosenBrowser = ui.lineEdit_browser->text();
if (cli_browsers.contains(chosenBrowser, Qt::CaseSensitive) ) {
// Support 2 terminals, roxterm and xterm. This probably won't work right if
// someone uses XDG-OPEN and it happens to point to a cli browser
QStringList sl_args = QStringList();
if (sl_terminals.contains("roxterm")) {
sl_args << "-T" << "Web Login" << "--execute" << "lynx" << ui.lineEdit_url->text();
sl_args << "-T" << "Web Login" << "--execute" << chosenBrowser << ui.lineEdit_url->text();
process->startDetached(QString("roxterm"), sl_args);
}
else if (sl_terminals.contains("xterm")) {
sl_args << "-T" << "Web Login" << "-e" << "lynx" << ui.lineEdit_url->text();
sl_args << "-T" << "Web Login" << "-e" << chosenBrowser << ui.lineEdit_url->text();
process->startDetached(QString("xterm"), sl_args);
}
else
......@@ -291,9 +294,8 @@ void AgentDialog::launchBrowser()
QString(TranslateStrings::cmtr("cmst")) + tr(" Information"),
tr("You have requested the %1 browser, but we cannot find a terminal program to open it with. " \
"Currenty we can start %1 using these terminals: <b>roxterm</b> and <b>xterm</b>." \
"<br><br>To continue you need to manually open a terminal and then enter: \"lynx %2\"").arg("Lynx").arg(ui.lineEdit_url->text()) );
} // lynx (CLI browser) is checked
if (ui.radioButton_other->isChecked() && ! ui.lineEdit_other_browser->text().isEmpty() )
process->startDetached(QString(ui.lineEdit_other_browser->text()), QStringList(ui.lineEdit_url->text()) );
"<br><br>To continue you need to manually open a terminal and then enter: \"%1 %2\"").arg(chosenBrowser).arg(ui.lineEdit_url->text()) );
} else {
process->startDetached(chosenBrowser, QStringList(ui.lineEdit_url->text()) );
}
}
......@@ -34,6 +34,7 @@ DEALINGS IN THE SOFTWARE.
# include <QDialog>
# include <QString>
# include <QVariant>
# include <QStringList>
# include "ui_agent.h"
......@@ -55,6 +56,8 @@ class AgentDialog : public QDialog
// members
Ui::Agent ui;
QString sys_env_path;
QStringList cli_browsers;
QStringList gui_browsers;
// functions
void initialize();
......@@ -63,11 +66,14 @@ class AgentDialog : public QDialog
void hidePassphrase(bool);
void useWPSPushButton(bool);
void showWhatsThis();
void useOtherBrowser(bool);
void launchBrowser();
void updateBrowserChoice(const QModelIndex&, const QModelIndex&);
void enteringBrowser(const QString&);
public:
inline void setWhatsThisIcon(QIcon icon) {ui.toolButton_whatsthis->setIcon(icon);}
inline QString getBrowser() {return ui.lineEdit_browser->text();}
inline void setBrowser(const QString& b) {ui.lineEdit_browser->setText(b);}
};
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>386</width>
<height>587</height>
<height>642</height>
</rect>
</property>
<property name="windowTitle">
......@@ -43,7 +43,7 @@
<item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="lineEdit_old_passphrase">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If an old passphrase is avaliable it will be shown here for reference.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If an old passphrase is available it will be shown here for reference.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
......@@ -70,7 +70,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_old_passphrase">
<property name="text">
<string>&amp;Old Passphrase</string>
<string>O&amp;ld Passphrase</string>
</property>
<property name="buddy">
<cstring>lineEdit_old_passphrase</cstring>
......@@ -286,10 +286,20 @@
<string>Browser Login Requested</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="3" column="0">
<widget class="QLineEdit" name="lineEdit_browser"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_browser">
<property name="text">
<string>Choose or enter a browser:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_browser_url">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Connman is requesting that you open a web browser to complete the login process.&lt;/p&gt;&lt;p&gt;We have scanned your PATH for browsers and any browsers we found are shown below as active. You may select any one browser to use it for the login. If your web browser is not shown active, or is not listed at all, select &lt;span style=&quot; font-weight:600;&quot;&gt;Other&lt;/span&gt; and type the command you would use to start your browser from a command line in the text box. To launch the browser click the &lt;span style=&quot; font-weight:600;&quot;&gt;Launch Browser&lt;/span&gt; button. &lt;/p&gt;&lt;p&gt;If you wish to login manually close this dialog, start your web browser and proceed to the URL shown below:&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Connman is requesting that you open a web browser to complete the login process.&lt;/p&gt;&lt;p&gt;We have scanned your PATH for browsers and any browsers found are shown in the list below. You may select any one browser to use it for the login. If your web browser is not shown in the list you may enter it directly in the&lt;span style=&quot; font-weight:600;&quot;&gt; Choose or enter a browser box&lt;/span&gt;.&lt;/p&gt;&lt;p&gt;To launch the browser click the &lt;span style=&quot; font-weight:600;&quot;&gt;Launch Browser&lt;/span&gt; button. &lt;/p&gt;&lt;p&gt;If you wish to login manually close this dialog, start your web browser and proceed to the URL shown in the &lt;span style=&quot; font-weight:600;&quot;&gt;Login URL&lt;/span&gt; box.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
......@@ -320,71 +330,7 @@
</item>
</layout>
</item>
<item row="2" column="0">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QRadioButton" name="radioButton_firefox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use the Firefox browser.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>&amp;Firefox</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QRadioButton" name="radioButton_opera">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use the Opera browser.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>&amp;Opera</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="radioButton_luakit">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use the Luakit browser.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>&amp;Luakit</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QRadioButton" name="radioButton_lynx">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use the Lynx (console mode) browser.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Lyn&amp;x</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QRadioButton" name="radioButton_other">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Login using a browser that is not listed. Type the browser start command in the box below.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Othe&amp;r</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLineEdit" name="lineEdit_other_browser">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Type the browser start command here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="5" column="0">
<item row="7" column="0">
<widget class="QPushButton" name="pushButton_launch_browser">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use this button to launch the selected browser. The browser will open at the page shown in the Login URL box.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
......@@ -394,7 +340,7 @@
</property>
</widget>
</item>
<item row="6" column="0">
<item row="8" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -407,6 +353,9 @@
</property>
</spacer>
</item>
<item row="4" column="0">
<widget class="QListView" name="listView_browsers"/>
</item>
</layout>
</widget>
</item>
......@@ -484,8 +433,8 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>226</x>
<y>512</y>
<x>289</x>
<y>630</y>
</hint>
<hint type="destinationlabel">
<x>233</x>
......@@ -500,8 +449,8 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>352</x>
<y>519</y>
<x>375</x>
<y>630</y>
</hint>
<hint type="destinationlabel">
<x>380</x>
......
......@@ -53,6 +53,7 @@ DEALINGS IN THE SOFTWARE.
# include "./code/agent/agent.h"
# include "./code/counter/counter.h"
# include "./code/notify/notify.h"
# include "./code/iconman/iconman.h"
// Two of the connman.Manager query functions will return an array of structures.
......@@ -117,6 +118,7 @@ class ControlBox : public QDialog
protected:
void closeEvent(QCloseEvent*);
void keyPressEvent(QKeyEvent*);
bool eventFilter(QObject*, QEvent*);
private:
......@@ -142,7 +144,6 @@ class ControlBox : public QDialog
QAction* minimizeAction;
QAction* maximizeAction;
QAction* exitAction;
bool b_useicontheme;
bool b_usexfce;
bool b_usemate;
QMenu* mvsrv_menu;
......@@ -150,6 +151,7 @@ class ControlBox : public QDialog
QString onlineobjectpath;
QLocalServer* socketserver;
QColor trayiconbackground;
IconManager* iconman;
// functions
int managerRescan(const int& srv = 0);
......@@ -158,7 +160,6 @@ class ControlBox : public QDialog
void assemblePage3();
void assemblePage4();
void assembleTrayIcon();
void createSystemTrayIcon(bool);
void sendNotifications();
bool getProperties();
bool getTechnologies();
......@@ -194,14 +195,13 @@ class ControlBox : public QDialog
void minMaxWindow(QAction* = 0);
void getServiceDetails(int);
void showWhatsThis();
inline void startSystemTrayMinimized() {createSystemTrayIcon(true);}
inline void startSystemTrayNormal() {createSystemTrayIcon(false);}
inline void trayNotifications(bool checked) {if (checked) ui.checkBox_notifydaemon->setChecked(false);}
inline void daemonNotifications(bool checked) {if (checked) ui.checkBox_systemtraynotifications->setChecked(false);}
void iconActivated(QSystemTrayIcon::ActivationReason reason);
void enableRunOnStartup(bool enabled);
void writeSettings();
void readSettings();
void createSystemTrayIcon();
void connectNotifyClient();
void configureService();
void provisionService();
......
......@@ -821,15 +821,28 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QCheckBox" name="checkBox_retainsettings">
<widget class="QCheckBox" name="checkBox_usestartoptions">
<property name="enabled">
<bool>true</bool>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked the GUI will be restored from settings saved on disk. Settings include the geometry of the dialog and the state of various check boxes, such as this one. &lt;/p&gt;&lt;p&gt;These settings will be used at next boot to restore the user interface to the way it was at shutdown.&lt;/p&gt;&lt;p style='white-space:pre'&gt;The settings file is: &lt;span style=&quot; font-weight:600;&quot;&gt;${HOME}/.config/cmst/cmst.conf &lt;/span&gt;&lt;br&gt;This is a standard ini type text file.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked the Start Options set here will be read and used next time the program starts. &lt;/p&gt;&lt;p&gt;Settings are stored in&lt;span style=&quot; font-family:'Courier New,courier';&quot;&gt;: ~&lt;/span&gt;&lt;span style=&quot; font-family:'Courier New,courier'; font-weight:600;&quot;&gt;/.config/cmst/cmst.conf &lt;/span&gt;&lt;span style=&quot; font-family:'Courier New,courier';&quot;&gt;&lt;br/&gt;This is a standard ini type text file.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Retain Settings</string>
<string>Use Start Options</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_retainstate">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked the state of the GUI will be restored from settings saved on disk. Settings include the geometry and position of the dialog and the current tab. &lt;/p&gt;&lt;p&gt;These settings will be used at next boot to restore the user interface to the way it was at shutdown.&lt;/p&gt;&lt;p&gt;The settings file is: ~&lt;span style=&quot; font-weight:600;&quot;&gt;/.config/cmst/cmst.conf &lt;/span&gt;&lt;br/&gt;This is a standard ini type text file.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Retain State</string>
</property>
</widget>
</item>
......@@ -975,11 +988,10 @@
<string/>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;pre style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Courier New,courier';&quot;&gt;Command Line Option: &lt;/span&gt;&lt;span style=&quot; font-family:'Courier New,courier'; font-weight:600;&quot;&gt;-i&lt;/span&gt;&lt;span style=&quot; font-family:'Courier New,courier';&quot;&gt; or &lt;/span&gt;&lt;span style=&quot; font-family:'Courier New,courier'; font-weight:600;&quot;&gt;--icon-theme&lt;/span&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;
&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use the icon theme from your system if one is defined.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;pre style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Courier New,courier';&quot;&gt;Command Line Option: &lt;/span&gt;&lt;span style=&quot; font-family:'Courier New,courier'; font-weight:600;&quot;&gt;-i&lt;/span&gt;&lt;span style=&quot; font-family:'Courier New,courier';&quot;&gt; or &lt;/span&gt;&lt;span style=&quot; font-family:'Courier New,courier'; font-weight:600;&quot;&gt;--icon-theme&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;Use an icon theme from your system. You may specify the theme in the box at the right, or if the box is left blank CMST will try and use the system wide icon theme (if one is defined).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Use System Icon Theme</string>
<string>Use Icon Theme</string>
</property>
</widget>
</item>
......@@ -1047,7 +1059,10 @@
<number>5</number>
</property>
<property name="maximum">
<number>600</number>
<number>86400</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="value">
<number>10</number>
......@@ -1085,7 +1100,7 @@
<string/>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;pre style=&quot;-qt-paragraph-type:empty; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier New,courier';&quot;&gt;&lt;br/&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;pre style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Courier New,courier';&quot;&gt;Command Line Option: &lt;/span&gt;&lt;span style=&quot; font-family:'Courier New,courier'; font-weight:600;&quot;&gt;--use-xfce&lt;/span&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>XFCE</string>
......@@ -1141,6 +1156,19 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_icontheme">
<property name="enabled">
<bool>false</bool>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Icon theme to use. For this theme to be used it must be installed on your system. If the theme is not installed, or if you spell the name wrong CMST will fall back to using its internal icon set.&lt;/p&gt;&lt;p&gt;If this box is blank CMST will try and use the system wide icon theme (if one is defined).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......@@ -1193,7 +1221,7 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox_notfications">
<widget class="QGroupBox" name="groupBox_notifications">
<property name="enabled">
<bool>true</bool>
</property>
......@@ -1504,7 +1532,7 @@
<tabstop>tableWidget_wifi</tabstop>
<tabstop>scrollArea_home_counter</tabstop>
<tabstop>scrollArea_roaming_counter</tabstop>
<tabstop>checkBox_retainsettings</tabstop>
<tabstop>checkBox_usestartoptions</tabstop>
<tabstop>checkBox_enableinterfacetooltips</tabstop>
<tabstop>checkBox_resetcounters</tabstop>
<tabstop>checkBox_hideIcon</tabstop>
......@@ -1532,8 +1560,8 @@
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>36</x>
<y>163</y>
<x>59</x>
<y>196</y>
</hint>
<hint type="destinationlabel">
<x>163</x>
......@@ -1628,8 +1656,8 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>468</x>
<y>275</y>
<x>466</x>
<y>286</y>
</hint>
<hint type="destinationlabel">
<x>531</x>
......@@ -1637,5 +1665,37 @@
</hint>
</hints>
</connection>
<connection>
<sender>checkBox_systemicontheme</sender>
<signal>toggled(bool)</signal>
<receiver>lineEdit_icontheme</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>407</x>
<y>136</y>
</hint>
<hint type="destinationlabel">
<x>483</x>
<y>136</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkBox_usestartoptions</sender>
<signal>clicked(bool)</signal>
<receiver>groupBox_startoptions</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>91</x>
<y>82</y>
</hint>
<hint type="destinationlabel">
<x>301</x>
<y>51</y>
</hint>
</hints>
</connection>
</connections>
</ui>
This diff is collapsed.
This diff is collapsed.
/**************************** iconman.h ******************************
Class to manage icons and allow the user to provide substitutions based
on the the system theme.
Copyright (C) 2015
by: Andrew J. Bibb
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
***********************************************************************/
# ifndef ICON_MANAGER
# define ICON_MANAGER
# include <QObject>
# include <QString>
# include <QStringList>
# include <QIcon>
# include <QMap>
# include "../resource.h"
struct IconElement
{
QString resource_path;
QString fdo_name;
QStringList name_list;
};
class IconManager : public QObject
{