From 4dc83e1ad7f059aeb41d6e401ebd677b56af676a Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Mon, 12 Jan 2009 02:49:17 +0100 Subject: [PATCH 1/1] Redesign network settings page --- .../settingspages/networkssettingspage.cpp | 25 +- src/qtui/settingspages/networkssettingspage.h | 2 +- .../settingspages/networkssettingspage.ui | 752 +++++++++--------- 3 files changed, 401 insertions(+), 378 deletions(-) diff --git a/src/qtui/settingspages/networkssettingspage.cpp b/src/qtui/settingspages/networkssettingspage.cpp index c2785a0e..7c98306f 100644 --- a/src/qtui/settingspages/networkssettingspage.cpp +++ b/src/qtui/settingspages/networkssettingspage.cpp @@ -42,6 +42,7 @@ NetworksSettingsPage::NetworksSettingsPage(QWidget *parent) : SettingsPage(tr("G ui.editServer->setIcon(SmallIcon("configure")); ui.upServer->setIcon(SmallIcon("go-up")); ui.downServer->setIcon(SmallIcon("go-down")); + ui.editIdentities->setIcon(SmallIcon("configure")); _ignoreWidgetChanges = false; @@ -68,12 +69,12 @@ NetworksSettingsPage::NetworksSettingsPage(QWidget *parent) : SettingsPage(tr("G connect(Client::instance(), SIGNAL(identityRemoved(IdentityId)), this, SLOT(clientIdentityRemoved(IdentityId))); connect(ui.identityList, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged())); - connect(ui.randomServer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged())); + //connect(ui.randomServer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged())); connect(ui.performEdit, SIGNAL(textChanged()), this, SLOT(widgetHasChanged())); connect(ui.autoIdentify, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged())); connect(ui.autoIdentifyService, SIGNAL(textEdited(const QString &)), this, SLOT(widgetHasChanged())); connect(ui.autoIdentifyPassword, SIGNAL(textEdited(const QString &)), this, SLOT(widgetHasChanged())); - connect(ui.useDefaultEncodings, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged())); + connect(ui.useCustomEncodings, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged())); connect(ui.sendEncoding, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged())); connect(ui.recvEncoding, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged())); connect(ui.serverEncoding, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged())); @@ -186,6 +187,7 @@ void NetworksSettingsPage::setWidgetStates() { ui.detailsBox->setEnabled(true); ui.renameNetwork->setEnabled(true); ui.deleteNetwork->setEnabled(true); + /* button disabled for now ui.connectNow->setEnabled(net); // && (Client::network(id)->connectionState() == Network::Initialized // || Client::network(id)->connectionState() == Network::Disconnected)); @@ -200,11 +202,11 @@ void NetworksSettingsPage::setWidgetStates() { } else { ui.connectNow->setIcon(QIcon()); ui.connectNow->setText(tr("Apply first!")); - } + } */ } else { ui.renameNetwork->setEnabled(false); ui.deleteNetwork->setEnabled(false); - ui.connectNow->setEnabled(false); + //ui.connectNow->setEnabled(false); ui.detailsBox->setEnabled(false); } // network details @@ -384,11 +386,14 @@ void NetworksSettingsPage::clientNetworkRemoved(NetworkId id) { } void NetworksSettingsPage::networkConnectionStateChanged(Network::ConnectionState state) { + Q_UNUSED(state); const Network *net = qobject_cast(sender()); if(!net) return; + /* if(net->networkId() == currentId) { ui.connectNow->setEnabled(state == Network::Initialized || state == Network::Disconnected); } + */ setItemState(net->networkId()); setWidgetStates(); } @@ -432,7 +437,7 @@ void NetworksSettingsPage::displayNetwork(NetworkId id) { ui.serverList->addItem(QString("%1:%2").arg(server.host).arg(server.port)); } //setItemState(id); - ui.randomServer->setChecked(info.useRandomServer); + //ui.randomServer->setChecked(info.useRandomServer); ui.performEdit->setPlainText(info.perform.join("\n")); ui.autoIdentify->setChecked(info.useAutoIdentify); ui.autoIdentifyService->setText(info.autoIdentifyService); @@ -441,12 +446,12 @@ void NetworksSettingsPage::displayNetwork(NetworkId id) { ui.sendEncoding->setCurrentIndex(ui.sendEncoding->findText(Network::defaultCodecForEncoding())); ui.recvEncoding->setCurrentIndex(ui.recvEncoding->findText(Network::defaultCodecForDecoding())); ui.serverEncoding->setCurrentIndex(ui.serverEncoding->findText(Network::defaultCodecForServer())); - ui.useDefaultEncodings->setChecked(true); + ui.useCustomEncodings->setChecked(false); } else { ui.sendEncoding->setCurrentIndex(ui.sendEncoding->findText(info.codecForEncoding)); ui.recvEncoding->setCurrentIndex(ui.recvEncoding->findText(info.codecForDecoding)); ui.serverEncoding->setCurrentIndex(ui.serverEncoding->findText(info.codecForServer)); - ui.useDefaultEncodings->setChecked(false); + ui.useCustomEncodings->setChecked(true); } ui.autoReconnect->setChecked(info.useAutoReconnect); ui.reconnectInterval->setValue(info.autoReconnectInterval); @@ -468,12 +473,12 @@ void NetworksSettingsPage::displayNetwork(NetworkId id) { void NetworksSettingsPage::saveToNetworkInfo(NetworkInfo &info) { info.identity = ui.identityList->itemData(ui.identityList->currentIndex()).toInt(); - info.useRandomServer = ui.randomServer->isChecked(); + //info.useRandomServer = ui.randomServer->isChecked(); info.perform = ui.performEdit->toPlainText().split("\n"); info.useAutoIdentify = ui.autoIdentify->isChecked(); info.autoIdentifyService = ui.autoIdentifyService->text(); info.autoIdentifyPassword = ui.autoIdentifyPassword->text(); - if(ui.useDefaultEncodings->isChecked()) { + if(!ui.useCustomEncodings->isChecked()) { info.codecForEncoding.clear(); info.codecForDecoding.clear(); info.codecForServer.clear(); @@ -571,6 +576,7 @@ void NetworksSettingsPage::on_renameNetwork_clicked() { } } +/* void NetworksSettingsPage::on_connectNow_clicked() { if(!ui.networkList->selectedItems().count()) return; NetworkId id = ui.networkList->selectedItems()[0]->data(Qt::UserRole).value(); @@ -579,6 +585,7 @@ void NetworksSettingsPage::on_connectNow_clicked() { if(net->connectionState() == Network::Disconnected) net->requestConnect(); else net->requestDisconnect(); } +*/ /*** Server list ***/ diff --git a/src/qtui/settingspages/networkssettingspage.h b/src/qtui/settingspages/networkssettingspage.h index 624ca9a3..e0d9684a 100644 --- a/src/qtui/settingspages/networkssettingspage.h +++ b/src/qtui/settingspages/networkssettingspage.h @@ -67,7 +67,7 @@ class NetworksSettingsPage : public SettingsPage { void on_deleteNetwork_clicked(); void on_renameNetwork_clicked(); - void on_connectNow_clicked(); + // void on_connectNow_clicked(); void on_serverList_itemSelectionChanged(); void on_addServer_clicked(); diff --git a/src/qtui/settingspages/networkssettingspage.ui b/src/qtui/settingspages/networkssettingspage.ui index 5f578f59..cf7274c9 100644 --- a/src/qtui/settingspages/networkssettingspage.ui +++ b/src/qtui/settingspages/networkssettingspage.ui @@ -5,123 +5,116 @@ 0 0 - 565 - 468 + 515 + 453 Form - + - + - - - QAbstractItemView::SelectRows - - - true - - - - - - - - 0 - 0 - - - - Re&name... - - - - :/16x16/actions/oxygen/16x16/actions/edit-rename.png:/16x16/actions/oxygen/16x16/actions/edit-rename.png - - - - - - - - 0 - 0 - - - - &Add... - - - - :/16x16/actions/oxygen/16x16/actions/list-add.png:/16x16/actions/oxygen/16x16/actions/list-add.png - - - - 16 - 16 - - - - - - - - - 0 - 0 - - - - De&lete - - - - :/16x16/actions/oxygen/16x16/actions/edit-delete.png:/16x16/actions/oxygen/16x16/actions/edit-delete.png - - - - - - - Qt::Vertical - - - - 131 - 71 - - - - - - - - false - - - - 0 - 0 - - - - Connect now - - - - - - - + + + + + + 1 + 10 + + + + QAbstractItemView::SelectRows + + + true + + + + + + + + + + 0 + 0 + + + + Re&name... + + + + :/16x16/actions/oxygen/16x16/actions/edit-rename.png:/16x16/actions/oxygen/16x16/actions/edit-rename.png + + + + + + + + 0 + 0 + + + + &Add... + + + + :/16x16/actions/oxygen/16x16/actions/list-add.png:/16x16/actions/oxygen/16x16/actions/list-add.png + + + + 16 + 16 + + + + + + + + + 0 + 0 + + + + De&lete + + + + :/16x16/actions/oxygen/16x16/actions/edit-delete.png:/16x16/actions/oxygen/16x16/actions/edit-delete.png + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + - + 10 0 @@ -149,6 +142,26 @@ + + + + ... + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -156,6 +169,12 @@ true + + + 0 + 0 + + @@ -172,163 +191,149 @@ Manage servers for this network - + + + + + + 1 + 0 + + + + - + + + + + + 0 + 0 + + + + &Edit... + + + + + + + + - + - - 1 + + 0 0 + + &Add... + + + + :/16x16/actions/oxygen/16x16/actions/list-add.png:/16x16/actions/oxygen/16x16/actions/list-add.png + - + + + + 0 + 0 + + + + De&lete + + + + :/16x16/actions/oxygen/16x16/actions/edit-delete.png:/16x16/actions/oxygen/16x16/actions/edit-delete.png + + + + + - - - - 0 - 0 - - - - &Edit... + + + Qt::Horizontal - - - - + + + 0 + 20 + - + - - - - 0 - 0 - + + + Move upwards in list - &Add... + ... - :/16x16/actions/oxygen/16x16/actions/list-add.png:/16x16/actions/oxygen/16x16/actions/list-add.png + :/16x16/actions/oxygen/16x16/actions/go-up.png:/16x16/actions/oxygen/16x16/actions/go-up.png - - - - 0 - 0 - + + + Move downwards in list - De&lete + ... - :/16x16/actions/oxygen/16x16/actions/edit-delete.png:/16x16/actions/oxygen/16x16/actions/edit-delete.png + :/16x16/actions/oxygen/16x16/actions/go-down.png:/16x16/actions/oxygen/16x16/actions/go-down.png - - - - - - Qt::Horizontal - - - - 0 - 20 - - - - - - - - Move upwards in list - - - ... - - - - :/16x16/actions/oxygen/16x16/actions/go-up.png:/16x16/actions/oxygen/16x16/actions/go-up.png - - - - - - - Move downwards in list - - - ... - - - - :/16x16/actions/oxygen/16x16/actions/go-down.png:/16x16/actions/oxygen/16x16/actions/go-down.png - - - - - - - Qt::Horizontal - - - - 0 - 20 - - - - - - - Qt::Vertical + Qt::Horizontal - 20 - 40 + 0 + 20 + + + + Qt::Vertical + + + + 20 + 40 + + + + - - - - true - - - Choose random server for connecting - - - - Perform + Commands Configure automatic identification or misc. commands to be executed after connecting to a server @@ -346,6 +351,12 @@ true + + + 0 + 0 + + Specify a list of IRC commands to be executed upon connect. Note that Quassel IRC automatically rejoins channels, so /join will rarely be needed here! @@ -355,6 +366,131 @@ Note that Quassel IRC automatically rejoins channels, so /join will rarely be ne + + + + + Connection + + + + + + true + + + Control automatic reconnect to the network + + + Automatic Reconnect + + + true + + + + + + + + Interval: + + + + + + + s + + + 10 + + + 3600 + + + 30 + + + + + + + Retries: + + + + + + + 1 + + + 999 + + + 10 + + + + + + + Unlimited + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + true + + + Rejoin all channels on reconnect + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 79 + + + + + + + + + Auto Identify + + @@ -410,18 +546,31 @@ Note that Quassel IRC automatically rejoins channels, so /join will rarely be ne + + + + Qt::Vertical + + + + 20 + 40 + + + + - Advanced + Encodings Configure advanced settings such as message encodings and automatic reconnect - + - + true @@ -429,7 +578,10 @@ Note that Quassel IRC automatically rejoins channels, so /join will rarely be ne Control encodings for in- and outgoing messages - Encodings + Use Custom Encodings + + + true @@ -448,7 +600,7 @@ UTF-8 should be a sane choice for most networks. - false + true @@ -479,7 +631,7 @@ This setting defines the encoding for messages that are not Utf8. - false + true @@ -510,7 +662,7 @@ Unless you *really* know what you do, leave this as ISO-8859-1! - false + true This specifies how control messages, nicks and servernames are encoded. @@ -520,109 +672,21 @@ Unless you *really* know what you do, leave this as ISO-8859-1! - - - - true - - - Use default settings for encodings (recommended) - - - Use defaults - - - true - - - - - - true + + + Qt::Vertical - - Control automatic reconnect to the network + + + 20 + 79 + - - Automatic Reconnect - - - true - - - - - - - - Interval: - - - - - - - s - - - 10 - - - 3600 - - - 30 - - - - - - - Retries: - - - - - - - 1 - - - 999 - - - 10 - - - - - - - Unlimited - - - - - - - - - false - - - Rejoin all channels on reconnect - - - true - - - - - + @@ -642,60 +706,12 @@ Unless you *really* know what you do, leave this as ISO-8859-1! setDisabled(bool) - 512 - 373 - - - 420 - 377 - - - - - useDefaultEncodings - toggled(bool) - sendEncoding - setDisabled(bool) - - - 659 - 262 - - - 471 - 176 - - - - - useDefaultEncodings - toggled(bool) - recvEncoding - setDisabled(bool) - - - 659 - 262 - - - 471 - 209 - - - - - useDefaultEncodings - toggled(bool) - serverEncoding - setDisabled(bool) - - - 396 - 251 + 173 + 296 - 456 - 230 + 118 + 294 -- 2.20.1