svnno****@sourc*****
svnno****@sourc*****
2009年 7月 11日 (土) 19:00:37 JST
Revision: 2395 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2395 Author: nogu Date: 2009-07-11 19:00:37 +0900 (Sat, 11 Jul 2009) Log Message: ----------- use KMessageBox instead of QMessageBox Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp kita/branches/KITA-KDE4/kita/src/writeview.cpp Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-11 08:13:46 UTC (rev 2394) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-11 10:00:37 UTC (rev 2395) @@ -18,7 +18,6 @@ #include <QtGui/QClipboard> #include <QtGui/QComboBox> #include <QtGui/QLabel> -#include <QtGui/QMessageBox> #include <QtGui/QTextBrowser> #include <QtGui/QToolButton> #include <Qt3Support/Q3PtrList> @@ -30,6 +29,7 @@ #include <kiconloader.h> #include <klocale.h> #include <kmenu.h> +#include <kmessagebox.h> #include <krun.h> #include <kstandarddirs.h> #include <kwindowsystem.h> @@ -408,11 +408,8 @@ void KitaBoardView::deleteLog(const KUrl& url) { - if (QMessageBox::warning(this, - "Kita", - i18n("Do you want to delete Log ?"), - QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default) - == QMessageBox::Ok) { + if (KMessageBox::warningYesNo(this, i18n("Do you want to delete Log ?"), + "Kita") == KMessageBox::Yes) { if (Kita::DatManager::deleteCache(url)) { ViewMediator::getInstance()->closeThreadTab(url); slotUpdateSubject(url); Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-11 08:13:46 UTC (rev 2394) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-11 10:00:37 UTC (rev 2395) @@ -14,13 +14,13 @@ #include <QtGui/QApplication> #include <QtGui/QClipboard> #include <QtGui/QCursor> -#include <QtGui/QMessageBox> #include <kaction.h> #include <kdebug.h> #include <khtml_events.h> #include <klocale.h> #include <kmenu.h> +#include <kmessagebox.h> #include <krun.h> #include <dom/html_element.h> #include <dom/html_misc.h> @@ -812,11 +812,9 @@ } else if (action == copyStrAct) { clipboard->setText(selectedText(), QClipboard::Clipboard); } else if (action == aboneWordAct) { - if (QMessageBox::information(view(), "Kita", - i18n("Do you want to add '%1' to abone list ?").arg(selectedText()), - QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default) - == QMessageBox::Ok) { - + if (KMessageBox::warningYesNo(view(), + i18n("Do you want to add '%1' to abone list ?") + .arg(selectedText())) == KMessageBox::Yes) { Kita::AboneConfig::aboneWordList().append(selectedText()); redrawHTMLPart(m_datURL, false); } @@ -1158,11 +1156,9 @@ KRun::runUrl(str, "text/html", view()); } else if (action == aboneNameAct) { - if (QMessageBox::information(view(), "Kita", - i18n("Do you want to add '%1' to abone list ?").arg(namestr), - QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default) - == QMessageBox::Ok) { - + if (KMessageBox::warningYesNo(view(), + i18n("Do you want to add '%1' to abone list ?").arg(namestr), + "Kita") == KMessageBox::Yes) { Kita::AboneConfig::aboneNameList().append(namestr); redrawHTMLPart(m_datURL, false); } @@ -1204,11 +1200,9 @@ } if (action == aboneAct) { // add ID to abone list - if (QMessageBox::information(view(), "Kita", - i18n("Do you want to add '%1' to abone list ?").arg(strid), - QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default) - == QMessageBox::Ok) { - + if (KMessageBox::warningYesNo(view(), + i18n("Do you want to add '%1' to abone list ?").arg(strid), + "Kita") == KMessageBox::Yes) { Kita::AboneConfig::aboneIDList().append(strid); redrawHTMLPart(m_datURL, false); } Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-11 08:13:46 UTC (rev 2394) +++ kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp 2009-07-11 10:00:37 UTC (rev 2395) @@ -11,13 +11,13 @@ #include "writetabwidget.h" #include <QtGui/QClipboard> -#include <QtGui/QMessageBox> #include <kaction.h> #include <kactioncollection.h> #include <kapplication.h> #include <kdebug.h> #include <klocale.h> +#include <kmessagebox.h> #include <kstdaccel.h> #include "writeview.h" @@ -54,21 +54,19 @@ { // TODO: machiBBS kakiko support. if (Kita::BoardManager::type(url) == Kita::Board_MachiBBS) { -// QMessageBox::warning(this, QString("<(_ _)>"), -// i18n("Can't write to machi BBS in this version.")); +// KMessageBox::sorry(this, +// i18n("Can't write to machi BBS in this version."), +// "<(_ _)>"); // return ; } /* view exists */ KitaWriteView* view = findWriteView(url); if (view) { - if (view->body().length()) { - - if (QMessageBox::warning(this, "Kita", - i18n("Do you want to clear the text?"), - QMessageBox::Ok, - QMessageBox::Cancel | QMessageBox::Default) == QMessageBox::Cancel) return ; + if (KMessageBox::warningYesNo(this, + i18n("Do you want to clear the text?"), "Kita") + == KMessageBox::No) return; } /* clear */ @@ -154,11 +152,9 @@ if (view == 0) return ; if (view->body().length()) { - if (QMessageBox::warning(this, "Kita", - i18n("If you close this dialog, you will lose text.\n" - "Do you want to close?"), - QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default) - == QMessageBox::Cancel) return ; + if (KMessageBox::warningYesNo(this, + i18n("If you close this dialog, you will lose text.\n" + "Do you want to close?"), "Kita") == KMessageBox::No) return; } KitaTabWidgetBase::deleteWidget(w); Modified: kita/branches/KITA-KDE4/kita/src/writeview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-11 08:13:46 UTC (rev 2394) +++ kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-11 10:00:37 UTC (rev 2395) @@ -17,7 +17,6 @@ #include <QtGui/QComboBox> #include <QtGui/QLabel> #include <QtGui/QLayout> -#include <QtGui/QMessageBox> #include <QtGui/QPushButton> #include <QtGui/QTextEdit> @@ -258,18 +257,11 @@ return ; } - switch (QMessageBox::warning(this, "Kita", - i18n("If you close this dialog, you will lose text.\n" - "Do you want to close?"), - QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default)) { - case QMessageBox::Ok: - setMessage(QString()); - m_parent->slotCloseCurrentTab(); - break; - case QMessageBox::Cancel: - // do nothing - break; - } + if (KMessageBox::warningYesNo(this, + i18n("If you close this dialog, you will lose text.\n" + "Do you want to close?"), "Kita") == KMessageBox::No) return; + setMessage(QString()); + m_parent->slotCloseCurrentTab(); }