From: Manuel Nickschas Date: Wed, 2 Jan 2008 17:27:29 +0000 (+0000) Subject: Various smaller stuff, some parts of the new identity settingspage, plus Quassel X-Git-Tag: 0.2.0-alpha1~264 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=d1f2e1324046ad4108d30434c92fc0a2d688ef09 Various smaller stuff, some parts of the new identity settingspage, plus Quassel now understands -p to let the core listen to a different port than the standard 4242. --- diff --git a/Quassel.kdevelop.filelist b/Quassel.kdevelop.filelist index b444efe9..cb57658f 100644 --- a/Quassel.kdevelop.filelist +++ b/Quassel.kdevelop.filelist @@ -29,8 +29,6 @@ src src/client src/client/buffer.cpp src/client/buffer.h -src/client/buffertreemodel.cpp -src/client/buffertreemodel.h src/client/client.cpp src/client/client.h src/client/client.pri @@ -166,6 +164,8 @@ src/qtui/settingsdlg.h src/qtui/settingspages src/qtui/settingspages.cpp src/qtui/settingspages.h +src/qtui/settingspages/identitiessettingspage.cpp +src/qtui/settingspages/identitiessettingspage.h src/qtui/settingspages/settingspages.pri src/qtui/topicwidget.cpp src/qtui/topicwidget.h diff --git a/build/targets/target.pri b/build/targets/target.pri index 764bacec..1441f63c 100644 --- a/build/targets/target.pri +++ b/build/targets/target.pri @@ -3,8 +3,8 @@ TEMPLATE = app include(../buildconf.pri) RESOURCES *= ../../i18n/i18n.qrc -TRANSLATIONS = quassel_de.ts \ - quassel_da.ts +TRANSLATIONS = quassel_da.ts \ + quassel_de.ts SRCPATH = ../../src OBJECTS_DIR = .$$TARGET diff --git a/i18n/quassel_de.qm b/i18n/quassel_de.qm index dbfafb6a..39d37d07 100644 Binary files a/i18n/quassel_de.qm and b/i18n/quassel_de.qm differ diff --git a/i18n/quassel_de.ts b/i18n/quassel_de.ts index 6f15e921..7335a4e0 100644 --- a/i18n/quassel_de.ts +++ b/i18n/quassel_de.ts @@ -1,5 +1,6 @@ + AboutDlg @@ -1351,7 +1352,7 @@ Networks using this identity will be reset to use the default identity. - + MainWidget @@ -1464,7 +1465,7 @@ p, li { white-space: pre-wrap; } Disconnect - + Trennen @@ -1906,9 +1907,6 @@ p, li { white-space: pre-wrap; } - - Server - ServerEditDlg @@ -1993,9 +1991,6 @@ p, li { white-space: pre-wrap; } - - SignalProxy - SqliteStorage diff --git a/src/common/global.cpp b/src/common/global.cpp index 9ecef3c6..53178dff 100644 --- a/src/common/global.cpp +++ b/src/common/global.cpp @@ -57,3 +57,5 @@ void Global::initIconMap() { //} Global::RunMode Global::runMode; +uint Global::defaultPort; + diff --git a/src/common/global.h b/src/common/global.h index 4b337d5c..da531859 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -30,13 +30,14 @@ /** The protocol version we use fo the communication between core and GUI */ #define GUI_PROTOCOL 3 -#define DEFAULT_PORT 4242 +//#define DEFAULT_PORT 4242 /* Some global stuff */ namespace Global { enum RunMode { Monolithic, ClientOnly, CoreOnly }; extern RunMode runMode; + extern unsigned int defaultPort; } #endif diff --git a/src/common/main.cpp b/src/common/main.cpp index f6da8f57..9f6f066b 100644 --- a/src/common/main.cpp +++ b/src/common/main.cpp @@ -65,6 +65,7 @@ int main(int argc, char **argv) { qRegisterMetaTypeStreamOperators("Message"); qRegisterMetaTypeStreamOperators("BufferInfo"); + #if defined BUILD_CORE Global::runMode = Global::CoreOnly; QCoreApplication app(argc, argv); @@ -86,6 +87,16 @@ int main(int argc, char **argv) { QCoreApplication::setApplicationName("Quassel IRC"); QCoreApplication::setOrganizationName("Quassel IRC Development Team"); // FIXME + // Check if a non-standard core port is requested + QStringList args = QCoreApplication::arguments(); + + Global::defaultPort = 4242; + int idx; + if((idx = args.indexOf("-p")) > 0 && idx < args.count() - 1) { + int port = args[idx+1].toInt(); + if(port >= 1024 && port < 65536) Global::defaultPort = port; + } + #ifndef BUILD_QTUI Core::instance(); // create and init the core #endif diff --git a/src/core/core.h b/src/core/core.h index fc20772c..1ceaec44 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -50,7 +50,7 @@ class Core : public QObject { static void restoreState(); private slots: - bool startListening(uint port = DEFAULT_PORT); + bool startListening(uint port = Global::defaultPort); void stopListening(); void incomingConnection(); void clientHasData(); diff --git a/src/core/coresettings.h b/src/core/coresettings.h index ea1b51b0..7b958b93 100644 --- a/src/core/coresettings.h +++ b/src/core/coresettings.h @@ -34,7 +34,7 @@ class CoreSettings : public Settings { QVariant databaseSettings(const QVariant &def = QVariant()); void setPort(const uint &port); - uint port(const uint &def = DEFAULT_PORT); + uint port(const uint &def = Global::defaultPort); void setCoreState(const QVariant &data); QVariant coreState(const QVariant &def = QVariant()); diff --git a/src/qtopia/coreconnectdlg.cpp b/src/qtopia/coreconnectdlg.cpp index 860f43e8..cb23d520 100644 --- a/src/qtopia/coreconnectdlg.cpp +++ b/src/qtopia/coreconnectdlg.cpp @@ -169,7 +169,7 @@ EditCoreAcctDlg::EditCoreAcctDlg(QString accname, QDialog *parent) : QDialog(par ui.accountEdit->setText(accountName()); if(accName.isEmpty()) { - ui.port->setValue(DEFAULT_PORT); + ui.port->setValue(Global::defaultPort); ui.accountEdit->setFocus(); } else { ui.hostEdit->setFocus(); diff --git a/src/qtopia/qtopiamainwin.cpp b/src/qtopia/qtopiamainwin.cpp index 63880587..68b2ef1e 100644 --- a/src/qtopia/qtopiamainwin.cpp +++ b/src/qtopia/qtopiamainwin.cpp @@ -47,6 +47,7 @@ QtopiaMainWin::QtopiaMainWin(QWidget *parent, Qt::WFlags flags) : QMainWindow(pa qRegisterMetaTypeStreamOperators("BufferInfo"); Global::runMode = Global::ClientOnly; + Global::defaultPort = 4242; QCoreApplication::setOrganizationDomain("quassel-irc.org"); QCoreApplication::setApplicationName("Quassel IRC"); diff --git a/src/qtui/coreconnectdlg.cpp b/src/qtui/coreconnectdlg.cpp index 3ba9c297..7e112db2 100644 --- a/src/qtui/coreconnectdlg.cpp +++ b/src/qtui/coreconnectdlg.cpp @@ -71,7 +71,7 @@ CoreConnectDlg::CoreConnectDlg(QWidget *parent, bool /*doAutoConnect*/) : QDialo if(!newacc.isEmpty()) { ui.accountList->addItem(newacc); ui.hostEdit->setText("localhost"); - ui.port->setValue(DEFAULT_PORT); + ui.port->setValue(Global::defaultPort); ui.internalCore->setChecked(false); setAccountEditEnabled(true); } diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 5e97426f..940fbb46 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -36,6 +36,7 @@ #include "mappedselectionmodel.h" #include "settingspages/fontssettingspage.h" +#include "settingspages/identitiessettingspage.h" #include "debugconsole.h" @@ -133,7 +134,6 @@ void MainWin::init() { //showSettingsDlg(); - } MainWin::~MainWin() { @@ -198,6 +198,7 @@ void MainWin::addBufferView(const QString &viewname, QAbstractItemModel *model, void MainWin::setupSettingsDlg() { settingsDlg->registerSettingsPage(new FontsSettingsPage(settingsDlg)); + settingsDlg->registerSettingsPage(new IdentitiesSettingsPage(settingsDlg)); } diff --git a/src/qtui/settingsdlg.cpp b/src/qtui/settingsdlg.cpp index 3945cd15..1750fa47 100644 --- a/src/qtui/settingsdlg.cpp +++ b/src/qtui/settingsdlg.cpp @@ -47,7 +47,7 @@ void SettingsDlg::registerSettingsPage(SettingsPage *sp) { pages[QString("%1$%2").arg(sp->category(), sp->title())] = sp; updateGeometry(); // TESTING - //selectPage(sp->category(), sp->title()); + selectPage(sp->category(), sp->title()); } void SettingsDlg::selectPage(const QString &cat, const QString &title) { diff --git a/src/qtui/settingspages/identitiessettingspage.cpp b/src/qtui/settingspages/identitiessettingspage.cpp new file mode 100644 index 00000000..a961712a --- /dev/null +++ b/src/qtui/settingspages/identitiessettingspage.cpp @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2005-08 by the Quassel IRC Team * + * devel@quassel-irc.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "identitiessettingspage.h" + +IdentitiesSettingsPage::IdentitiesSettingsPage(QWidget *parent) + : SettingsPage(tr("General"), tr("Identities"), parent) { + + ui.setupUi(this); + + +} + +bool IdentitiesSettingsPage::hasChanged() const { + +} + +void IdentitiesSettingsPage::save() { + +} + +void IdentitiesSettingsPage::load() { + +} + +void IdentitiesSettingsPage::defaults() { + +} diff --git a/src/qtui/settingspages/identitiessettingspage.h b/src/qtui/settingspages/identitiessettingspage.h new file mode 100644 index 00000000..5d6dd232 --- /dev/null +++ b/src/qtui/settingspages/identitiessettingspage.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (C) 2005-08 by the Quassel IRC Team * + * devel@quassel-irc.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _IDENTITIESSETTINGSPAGE_H_ +#define _IDENTITIESSETTINGSPAGE_H_ + +#include "settingspage.h" + +#include "ui_identitiessettingspage.h" + +class IdentitiesSettingsPage : public SettingsPage { + Q_OBJECT + + public: + IdentitiesSettingsPage(QWidget *parent = 0); + + bool hasChanged() const; + + public slots: + void save(); + void load(); + void defaults(); + + private: + Ui::IdentitiesSettingsPage ui; + +}; + +#endif diff --git a/src/qtui/settingspages/identitiessettingspage.ui b/src/qtui/settingspages/identitiessettingspage.ui new file mode 100644 index 00000000..0a221675 --- /dev/null +++ b/src/qtui/settingspages/identitiessettingspage.ui @@ -0,0 +1,589 @@ + + IdentitiesSettingsPage + + + + 0 + 0 + 422 + 380 + + + + Form + + + + + + + + + + + Add... + + + :/22x22/actions/oxygen/22x22/actions/list-add-user.png + + + + 22 + 22 + + + + Qt::ToolButtonIconOnly + + + + + + + ... + + + :/22x22/actions/oxygen/22x22/actions/user-properties.png + + + + 22 + 22 + + + + + + + + ... + + + :/22x22/actions/oxygen/22x22/actions/list-remove-user.png + + + + 22 + 22 + + + + + + + + + + 0 + + + + General + + + + + + + + Real Name: + + + + + + + + + + + + Nicknames + + + + + + + 1 + 0 + + + + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + &Add... + + + :/16x16/actions/oxygen/16x16/actions/list-add.png + + + + 16 + 16 + + + + + + + + + 0 + 0 + + + + Re&name... + + + :/16x16/actions/oxygen/16x16/actions/edit-rename.png + + + + + + + + 0 + 0 + + + + De&lete + + + :/16x16/actions/oxygen/16x16/actions/edit-delete.png + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 0 + 20 + + + + + + + + Move upwards in list + + + ... + + + :/16x16/actions/oxygen/16x16/actions/go-up.png + + + + + + + Move downwards in list + + + ... + + + :/16x16/actions/oxygen/16x16/actions/go-down.png + + + + + + + Qt::Horizontal + + + + 0 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + A&way + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + 6 + + + + + + + + Away Reason + + + + + + + + + + Return Message + + + + + + + + + + Away Nick + + + + + + + + + Auto Away + + + true + + + false + + + + 6 + + + 8 + + + 8 + + + 8 + + + 8 + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Auto away after + + + + + + + + + + minutes + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + 6 + + + + + Return Message + + + + + + + Away Reason + + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Advanced + + + + + + + + Ident: + + + + + + + + + + + + Messages + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + 6 + + + + + Part Reason: + + + + + + + + + + + + + Quit Reason: + + + + + + + + + + Kick Reason: + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + diff --git a/src/qtui/settingspages/settingspages.pri b/src/qtui/settingspages/settingspages.pri index 01a78418..8aec6ed3 100644 --- a/src/qtui/settingspages/settingspages.pri +++ b/src/qtui/settingspages/settingspages.pri @@ -1,4 +1,4 @@ -SETTINGSPAGES = fonts +SETTINGSPAGES = fonts identities # Specify additional files here! diff --git a/src/qtui/ui/mainwin.ui b/src/qtui/ui/mainwin.ui index 4a92932f..5d5e5adf 100644 --- a/src/qtui/ui/mainwin.ui +++ b/src/qtui/ui/mainwin.ui @@ -46,7 +46,7 @@ 0 0 800 - 22 + 26 @@ -170,6 +170,9 @@ + + :/16x16/actions/oxygen/16x16/actions/configure.png + Configure Quassel... @@ -244,7 +247,9 @@
bufferwidget.h
- + + + actionQuit