Summary: | warning dialog for pasting large text does not update the preferences when told not to ask again | ||
---|---|---|---|
Product: | [Applications] konversation | Reporter: | Niek Beernink <n.beernink> |
Component: | general | Assignee: | Konversation Developers <konversation-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Niek Beernink
2006-08-22 11:01:26 UTC
"Automatically join channel on invite" seems to be suffering the same problem. SVN commit 576858 by hein: Handle the tri-state "Large Paste" warning correctly in the "Warning Dialogs" prefs page. BUG:132792 M +2 -0 ChangeLog M +1 -1 src/commit.h M +4 -6 src/ircinput.cpp M +37 -7 src/warnings_preferences.cpp --- trunk/extragear/network/konversation/ChangeLog #576857:576858 @@ -182,6 +182,8 @@ - Disable input box and context menus in status, query and channel tabs on dis- connect, and purge nicklists in channels. - Make auto-reconnect pref apply at runtime. +- Handle the tri-state "Large Paste" warning correctly in the "Warning Dialogs" + prefs page. Changes from 0.18 to 0.19 We are extremely pleased to announce the immediate release of Konversation 0.19. The focus --- trunk/extragear/network/konversation/src/commit.h #576857:576858 @@ -1,4 +1,4 @@ // This COMMIT number is added to version string to be used as "patch level" #ifndef COMMIT -#define COMMIT 3138 +#define COMMIT 3139 #endif --- trunk/extragear/network/konversation/src/ircinput.cpp #576857:576858 @@ -458,25 +458,23 @@ if(text.length()>256 || lines) { doPaste=KMessageBox::warningYesNoCancel - ( - 0, + (this, i18n("<qt>You are attempting to paste a large portion of text (%1 bytes or %2 lines) into " "the chat. This can cause connection resets or flood kills. " "Do you really want to continue?</qt>").arg(text.length()).arg(lines+1), i18n("Large Paste Warning"), i18n("Paste"), i18n("&Edit..."), - "LargePaste" - ); + "LargePaste"); } - if(doPaste==KMessageBox::No) + if (doPaste==KMessageBox::No) { text=MultilineEdit::edit(this,text); return true; } - return(doPaste==KMessageBox::Yes); + return (doPaste==KMessageBox::Yes); } void IRCInput::showCompletionList(const QStringList& nicks) --- trunk/extragear/network/konversation/src/warnings_preferences.cpp #576857:576858 @@ -58,12 +58,33 @@ QString warningsChecked; QCheckListItem* item=static_cast<QCheckListItem*>(dialogListView->itemAtIndex(0)); - int i=0; + int i = 0; while(item) { // save state of this item in hasChanged() list warningsChecked+=item->isOn(); - config->writeEntry(item->text(2),item->isOn() ? "1" : "0"); + + if (item->text(2) == "LargePaste") + { + if (item->isOn()) + { + config->writeEntry(item->text(2), 1); + } + else + { + QString state = config->readEntry(item->text(2)); + + if (!state.isEmpty() && (state == "yes" || state == "no")) + config->writeEntry(item->text(2), state); + else + config->writeEntry(item->text(2), "yes"); + } + } + else + { + config->writeEntry(item->text(2),item->isOn() ? "1" : "0"); + } + item=static_cast<QCheckListItem*>(item->itemBelow()); ++i; } @@ -75,15 +96,11 @@ void Warnings_Config::loadSettings() { QStringList dialogDefinitions; - //QString flagNames = "Invitation,SaveLogfileNote,ClearLogfileQuestion,CloseQueryAfterIgnore,ResumeTransfer,ReconnectDifferentServer,QuitServerTab,QuitChannelTab,QuitQueryTab,ChannelListNoServerSelected,RemoveDCCReceivedFile,HideMenuBarWarning,ChannelListWarning,LargePaste"; QString flagNames = "Invitation,SaveLogfileNote,ClearLogfileQuestion,CloseQueryAfterIgnore,ReconnectDifferentServer,QuitServerTab,QuitChannelTab,QuitQueryTab,ChannelListNoServerSelected,RemoveDCCReceivedFile,HideMenuBarWarning,ChannelListWarning,LargePaste,IgnoreNick,UnignoreNick"; dialogDefinitions.append(i18n("Automatically join channel on invite")); dialogDefinitions.append(i18n("Notice that saving logfiles will save whole file")); dialogDefinitions.append(i18n("Ask before deleting logfile contents")); dialogDefinitions.append(i18n("Ask about closing queries after ignoring the nickname")); - #if 0 - dialogDefinitions.append(i18n("Ask about what to do on DCC resume")); - #endif dialogDefinitions.append(i18n("Ask before connecting to a different server in the network")); dialogDefinitions.append(i18n("Close server tab")); dialogDefinitions.append(i18n("Close channel tab")); @@ -107,7 +124,20 @@ item->setText(1,dialogDefinitions[i]); flagName = flagNames.section(",",i,i); item->setText(2,flagName); - item->setOn(config->readBoolEntry(flagName,true)); + + if (flagName == "LargePaste") + { + QString state = config->readEntry(flagName); + + if (state == "yes" || state == "no") + item->setOn(false); + else + item->setOn(true); + } + else + { + item->setOn(config->readBoolEntry(flagName,true)); + } } // remember checkbox state for hasChanged() m_oldWarningsChecked=currentWarningsChecked(); |