[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim
From:       Thomas McGuire <mcguire () kde ! org>
Date:       2009-06-24 16:43:50
Message-ID: 1245861830.724883.12602.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 986446 by tmcguire:

Merged revisions 973822,974443 via svnmerge from 
svn+ssh://tmcguire@svn.kde.org/home/kde/branches/kdepim/enterprise4/kdepim

........
  r973822 | tmcguire | 2009-05-27 23:37:14 +0200 (Wed, 27 May 2009) | 3 lines
  
  When disabling the HTML toolbar, ask the user before destroying the formatting.
  Idea taken from Mailody.
........
  r974443 | tmcguire | 2009-05-29 13:47:44 +0200 (Fri, 29 May 2009) | 1 line
  
  Actually make the string translatebale.
........


 _M            . (directory)  
 M  +30 -12    kmail/kmcomposewin.cpp  
 M  +2 -1      kmail/kmcomposewin.h  


** trunk/KDE/kdepim #property svnmerge-integrated
   - /branches/kdepim/enterprise4/kdepim:1-809779,809818-812631,812633-813585,813587-8 \
13603,813605-813670,813672-816390,816392-817226,817228-817261,817263-817679,817681-818 \
695,818697-819956,819958-819963,819965-823883,823885-827552,827723,827832-829047,82904 \
9-829050,829052-833251,833747,834308,834950-834951,834955-834958,834961-834968,834977- \
834992,835010,835023,835028-835042,835049,835071,835074,835078-835080,835083,835085,83 \
5088-835093,835096,835107,835112-835342,835353,835355,835357-835363,835365-835380,8353 \
82-835383,835395,835397,835400-835403,835408-835411,835415,835426,835430-835432,835434 \
-835435,835437,835439-835440,835447,835451-835938,836295,836363,836390,836393-836394,8 \
36404,836408,836472,836498,836510,836512,836524,837586,837719,837823,839641,839986-840 \
017,840019-840127,841817,841844,841986,841990,842323,842333,842495,842562-843750,84375 \
2-843753,843755-849403,849405-849784,849786-850255,850258-850261,850263-850305,850307-850329,850331-850387,850389-850421,850423-85
  0483,850485-850486,850488-850497,850499-850502,850504-850505,850507-850509,850511,85 \
0513-850573,850575-851249,851251-851253,851256-851293,851297-851306,851308-851309,8513 \
12,851314-851316,851320,851322,851325-851328,851333,851336,851342,851349,851351-851352 \
,851354,851358,851360-851371,851373,851376,851378,851380,851384,851389,851391,851395-8 \
51397,851399-852143,852637,852652,852736,852743,852759,853293,853769,853818,853947-853 \
957,853973,853982,853985,854004,854007,854025,854085,854399,854550-854628,856089,85632 \
4,856353,856356,856361,856370,856384,856528,856547,856635,856673,856711,856725-856726, \
856729,856734,856739,856952,856974,857033,857036-857038,857040,857047,857055,857076,85 \
7081-857082,857085,857148,857290,857305,857308,857310,857380,857396,857410,857444,8574 \
86,857528,857531,857534,857738,857772,857783,857799,858454,858464,858487,858688,858732 \
,858746,858755,858823,858838,859400,859888,860040,860059,860265,861198,861561,861815,861913,863905,863970,864002,866383,866597,8666
  82,866739,867069,867093,867475,867479,867497,868399-868400,868510,868512,868517,8685 \
33,868546,868795,868797,868813-868814,868935,869610,869627,869630,871375,872627-872628 \
,872861,872863,872887,872959,872969,873832,874391,874421,874707,874709,875182-875183,8 \
75188-875466,875468-875505,876312,876371,876380,876554,876637,876866,877028,877087,877 \
093,877099,877101-877103,877128-877129,877464,877481,877792,877794,877816,877930,87959 \
8-882331,882333-883958,883960-883963,883965-883968,883970,883972-883975,883977-883981, \
883983,883987,883993-883995,883997-883998,884002-884008,884015-884327,884329-885958,88 \
5960-887405,887407,887409-887663,887665-889343,889345-890603,894938,896104,896117,8961 \
22,898168,898171,898186,898616,898658,898963,898966-898974,898976-899293,900455,900706 \
,903577,905807,906910,909818,909832,909849-909850,909872,909889,910070,915154,915223,9 \
15225,915260,915287,915679,915720,915725,917688,918197,918237,918578,918582-918583,918709,921778,922041,924667,924727,924755,924758
  ,924763,924766,925261,927487,928226,928232,928235,928240,928244,928246,928257-928285 \
,928287-928290,928292,928295-928296,928299-928308,928310,928313-928314,928316,928323,9 \
28325-928326,928328-928334,928337-928340,928343,928345-928352,928354-928359,928361-928 \
385,928387-928871,928874-930366,930372,930375-930520,930522-931400,931402-931403,93140 \
5-931406,931408-931591,931593,931595-931597,931602,931605,931607,931610-931612,931614, \
931617-931618,931620-932375,932447,932662,932674,932684,932725,932773,932882,934932,93 \
4940,934942,935002,935004-935005,935007,935018-935019,935021-935022,935042,935217,9352 \
28,935706,936467,937830,937850,937852,938080,938085,938087,938089-938090,938098,938103 \
,938113,938122,938172,938837-938844,940212,940215,940217-940219,940221,941504,941515,9 \
41730,941736,941738-941739,941808,941812,943067,943122,943129,943199,943730,943732-943 \
733,943755,943833,943847,943906,943912,944847,944850,944924,944950-944957,944959-945303,945305-945328,945330-945344,945346-947276,9
  47278-947463,947465-948212,948214-948250,948253-948310,948312-948326,948328-948333,9 \
48336-948640,948642-948667,948669-948685,948687-948704,948706-948708,948710,948712-949 \
994,949996-950008,950010-950093,950095-950193,950195-951097,951099-951505,951507-95151 \
4,951516-951806,951808-951809,951812-951887,951889-951890,951894-951919,951921-951922, \
951924-951942,951944-951964,951966-953091,953093-953549,953590,953652,953931,953962,95 \
4387,955059,955061,956783-956784,956796,956798,956808,956870,957554,957556,957558,9575 \
60,957565,957591,957595,957625,958596,958755,958759,959905-959908,959937-959938,959942 \
,959948-959949,959959,959961,959963,959992,960005,960101,960106,960134,960337,960343,9 \
60715-960716,960925,960990,960995,961010,961090,961182-961283,961285-961698,961700,961 \
705,961709-961712,961714-961715,961720,961722-961724,961731-961732,961734-961755,96175 \
7-961760,961762,961764-961858,961860-962328,962330-962593,962595-962664,962666-962675,962677-962803,962805-962808,962810-963289,963
  782,964044,964350,964446,964931,965019,965053,965206,965363,966609,966693,966821,967 \
136,967419,967432,967863,968236,968393,968658,968827,969714-969715,969767-969804,97020 \
6,970486,970489,970740,970742,970747,970752-970753,970761,970792,970940,970943,971085, \
971568,972770,972787,972793,972796,972799,973507,973661-973662,973934,973945,973950,97 \
4128-974162,974164-974416,974418-974429,974431-974432,974434-974442,974444-974859,977490,979854,979874,979886,980262,981052,982309,982636,983112 \
/branches/kdepim/soc/kdepim:1-976464 /branches/work/akonadi-ports/kdepim:1-982690  + \
/branches/kdepim/enterprise4/kdepim:1-809779,809818-812631,812633-813585,813587-813603 \
,813605-813670,813672-816390,816392-817226,817228-817261,817263-817679,817681-818695,8 \
18697-819956,819958-819963,819965-823883,823885-827552,827723,827832-829047,829049-829 \
050,829052-833251,833747,834308,834950-834951,834955-834958,834961-834968,834977-83499 \
2,835010,835023,835028-835042,835049,835071,835074,835078-835080,835083,835085,835088- \
835093,835096,835107,835112-835342,835353,835355,835357-835363,835365-835380,835382-83 \
5383,835395,835397,835400-835403,835408-835411,835415,835426,835430-835432,835434-8354 \
35,835437,835439-835440,835447,835451-835938,836295,836363,836390,836393-836394,836404 \
,836408,836472,836498,836510,836512,836524,837586,837719,837823,839641,839986-840017,8 \
40019-840127,841817,841844,841986,841990,842323,842333,842495,842562-843750,843752-843 \
753,843755-849403,849405-849784,849786-850255,850258-850261,850263-850305,850307-850329,850331-850387,850389-850421,850423-85
  0483,850485-850486,850488-850497,850499-850502,850504-850505,850507-850509,850511,85 \
0513-850573,850575-851249,851251-851253,851256-851293,851297-851306,851308-851309,8513 \
12,851314-851316,851320,851322,851325-851328,851333,851336,851342,851349,851351-851352 \
,851354,851358,851360-851371,851373,851376,851378,851380,851384,851389,851391,851395-8 \
51397,851399-852143,852637,852652,852736,852743,852759,853293,853769,853818,853947-853 \
957,853973,853982,853985,854004,854007,854025,854085,854399,854550-854628,856089,85632 \
4,856353,856356,856361,856370,856384,856528,856547,856635,856673,856711,856725-856726, \
856729,856734,856739,856952,856974,857033,857036-857038,857040,857047,857055,857076,85 \
7081-857082,857085,857148,857290,857305,857308,857310,857380,857396,857410,857444,8574 \
86,857528,857531,857534,857738,857772,857783,857799,858454,858464,858487,858688,858732 \
,858746,858755,858823,858838,859400,859888,860040,860059,860265,861198,861561,861815,861913,863905,863970,864002,866383,866597,8666
  82,866739,867069,867093,867475,867479,867497,868399-868400,868510,868512,868517,8685 \
33,868546,868795,868797,868813-868814,868935,869610,869627,869630,871375,872627-872628 \
,872861,872863,872887,872959,872969,873832,874391,874421,874707,874709,875182-875183,8 \
75188-875466,875468-875505,876312,876371,876380,876554,876637,876866,877028,877087,877 \
093,877099,877101-877103,877128-877129,877464,877481,877792,877794,877816,877930,87959 \
8-882331,882333-883958,883960-883963,883965-883968,883970,883972-883975,883977-883981, \
883983,883987,883993-883995,883997-883998,884002-884008,884015-884327,884329-885958,88 \
5960-887405,887407,887409-887663,887665-889343,889345-890603,894938,896104,896117,8961 \
22,898168,898171,898186,898616,898658,898963,898966-898974,898976-899293,900455,900706 \
,903577,905807,906910,909818,909832,909849-909850,909872,909889,910070,915154,915223,9 \
15225,915260,915287,915679,915720,915725,917688,918197,918237,918578,918582-918583,918709,921778,922041,924667,924727,924755,924758
  ,924763,924766,925261,927487,928226,928232,928235,928240,928244,928246,928257-928285 \
,928287-928290,928292,928295-928296,928299-928308,928310,928313-928314,928316,928323,9 \
28325-928326,928328-928334,928337-928340,928343,928345-928352,928354-928359,928361-928 \
385,928387-928871,928874-930366,930372,930375-930520,930522-931400,931402-931403,93140 \
5-931406,931408-931591,931593,931595-931597,931602,931605,931607,931610-931612,931614, \
931617-931618,931620-932375,932447,932662,932674,932684,932725,932773,932882,934932,93 \
4940,934942,935002,935004-935005,935007,935018-935019,935021-935022,935042,935217,9352 \
28,935706,936467,937830,937850,937852,938080,938085,938087,938089-938090,938098,938103 \
,938113,938122,938172,938837-938844,940212,940215,940217-940219,940221,941504,941515,9 \
41730,941736,941738-941739,941808,941812,943067,943122,943129,943199,943730,943732-943 \
733,943755,943833,943847,943906,943912,944847,944850,944924,944950-944957,944959-945303,945305-945328,945330-945344,945346-947276,9
  47278-947463,947465-948212,948214-948250,948253-948310,948312-948326,948328-948333,9 \
48336-948640,948642-948667,948669-948685,948687-948704,948706-948708,948710,948712-949 \
994,949996-950008,950010-950093,950095-950193,950195-951097,951099-951505,951507-95151 \
4,951516-951806,951808-951809,951812-951887,951889-951890,951894-951919,951921-951922, \
951924-951942,951944-951964,951966-953091,953093-953549,953590,953652,953931,953962,95 \
4387,955059,955061,956783-956784,956796,956798,956808,956870,957554,957556,957558,9575 \
60,957565,957591,957595,957625,958596,958755,958759,959905-959908,959937-959938,959942 \
,959948-959949,959959,959961,959963,959992,960005,960101,960106,960134,960337,960343,9 \
60715-960716,960925,960990,960995,961010,961090,961182-961283,961285-961698,961700,961 \
705,961709-961712,961714-961715,961720,961722-961724,961731-961732,961734-961755,96175 \
7-961760,961762,961764-961858,961860-962328,962330-962593,962595-962664,962666-962675,962677-962803,962805-962808,962810-963289,963
  782,964044,964350,964446,964931,965019,965053,965206,965363,966609,966693,966821,967 \
136,967419,967432,967863,968236,968393,968658,968827,969714-969715,969767-969804,97020 \
6,970486,970489,970740,970742,970747,970752-970753,970761,970792,970940,970943,971085, \
971568,972770,972787,972793,972796,972799,973507,973661-973662,973822-974162,974164-97 \
4416,974418-974429,974431-974432,974434-974859,977490,979854,979874,979886,980262,981052,982309,982636,983112 \
                /branches/kdepim/soc/kdepim:1-976464 \
                /branches/work/akonadi-ports/kdepim:1-982690
--- trunk/KDE/kdepim/kmail/kmcomposewin.cpp #986445:986446
@@ -3389,7 +3389,7 @@
 void KMComposeWin::forceDisableHtml()
 {
   mForceDisableHtml = true;
-  disableHtml();
+  disableHtml( NoConfirmationNeeded );
   markupAction->setEnabled( false );
   // FIXME: Remove the toggle toolbar action somehow
 }
@@ -3567,12 +3567,12 @@
       mEncryptAction->setChecked( false );
       mSignAction->setChecked( false );
     } else {
-      disableHtml();
+      disableHtml( NoConfirmationNeeded );
     }
   }
 
   if ( mForceDisableHtml )
-    disableHtml();
+    disableHtml( NoConfirmationNeeded );
 
   if ( neverEncrypt && saveIn != KMComposeWin::None ) {
       // we can't use the state of the mail itself, to remember the
@@ -3856,13 +3856,18 @@
 void KMComposeWin::enableHtml()
 {
   if ( mForceDisableHtml ) {
-    disableHtml();;
+    disableHtml( NoConfirmationNeeded );;
     return;
   }
 
   mEditor->enableRichTextMode();
-  if ( !toolBar( "htmlToolBar" )->isVisible() )
-    toolBar( "htmlToolBar" )->show();
+  if ( !toolBar( "htmlToolBar" )->isVisible() ) {
+    // Use singleshot, as we we might actually be called from a slot that wanted to \
disable the +    // toolbar (but the messagebox in disableHtml() prevented that and \
called us). +    // The toolbar can't correctly deal with being enabled right in a \
slot called from the "disabled" +    // signal, so wait one event loop run for that.
+    QTimer::singleShot( 0, toolBar( "htmlToolBar" ), SLOT( show() ) );
+  }
   if ( !markupAction->isChecked() )
     markupAction->setChecked( true );
 
@@ -3871,12 +3876,25 @@
 }
 
 //-----------------------------------------------------------------------------
-void KMComposeWin::disableHtml()
+void KMComposeWin::disableHtml( Confirmation confirmation )
 {
+  if ( confirmation == LetUserConfirm && mEditor->isFormattingUsed() && \
!mForceDisableHtml ) { +    int choice = KMessageBox::warningContinueCancel( this, \
i18n( "Turning HTML mode off " +        "will cause the text to lose the formatting. \
Are you sure?" ), +        i18n( "Lose the formatting?" ), KGuiItem( i18n( "Lose \
Formatting" ) ), KStandardGuiItem::cancel(), +              "LoseFormattingWarning" \
); +    if ( choice != KMessageBox::Continue ) {
+      enableHtml();
+      return;
+    }
+  }
+
   mEditor->switchToPlainText();
   slotUpdateFont();
-  if ( toolBar( "htmlToolBar" )->isVisible() )
-    toolBar( "htmlToolBar" )->hide();
+  if ( toolBar( "htmlToolBar" )->isVisible() ) {
+    // See the comment in enableHtml() why we use a singleshot timer, similar \
situation here. +    QTimer::singleShot( 0, toolBar( "htmlToolBar" ), SLOT( hide() ) \
); +  }
   if ( markupAction->isChecked() )
     markupAction->setChecked( false );
 }
@@ -3887,14 +3905,14 @@
   if ( markupAction->isChecked() )
     enableHtml();
   else
-    disableHtml();
+    disableHtml( LetUserConfirm );
 }
 
 //-----------------------------------------------------------------------------
 void KMComposeWin::slotTextModeChanged( KPIM::KMeditor::Mode mode )
 {
   if ( mode == KMeditor::Plain )
-    disableHtml();
+    disableHtml( NoConfirmationNeeded ); // ### Can this happen at all?
   else
     enableHtml();
 }
@@ -3905,7 +3923,7 @@
   if ( visible )
     enableHtml();
   else
-    disableHtml();
+    disableHtml( LetUserConfirm );
 }
 
 //-----------------------------------------------------------------------------
--- trunk/KDE/kdepim/kmail/kmcomposewin.h #986445:986446
@@ -262,7 +262,8 @@
       * Disables the HTML mode, by hiding the HTML toolbar and unchecking the
       * "Formatting" action. Also, removes all rich-text formatting.
       */
-     void disableHtml();
+     enum Confirmation { LetUserConfirm, NoConfirmationNeeded };
+     void disableHtml( Confirmation confirmation );
 
      /**
       * Tries to find the given mimetype @p type in the KDE Mimetype registry.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic