Changeset 5889

Show
Ignore:
Timestamp:
11/28/07 10:39:17 (12 months ago)
Author:
eugene
Message:

Added the ability to load the old config file.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/qt-gui_qt4/src/core/licqgui.cpp

    r5888 r5889  
    284284    // Don't allow anymore writes 
    285285    licqConf.SetFlags(0); 
     286 
     287    // Now try to load the old config file, set the original config file back 
     288    // in case of error or if user doesn't want to load it. 
     289    snprintf(szTemp, MAX_FILENAME_LEN, "%s%s", BASE_DIR, "licq_qt-gui.conf"); 
     290    szTemp[MAX_FILENAME_LEN - 1] = '\0'; 
     291    if (!licqConf.LoadFile(szTemp) || 
     292        !QueryYesNo(NULL, 
     293          tr("There was an error loading the default configuration file.\n" 
     294            "Would you like to try loading the old one?"))) 
     295    { 
     296      snprintf(szTemp, MAX_FILENAME_LEN, "%s%s", BASE_DIR, QTGUI_CONFIGFILE); 
     297      szTemp[MAX_FILENAME_LEN - 1] = '\0'; 
     298      licqConf.LoadFile(szTemp); 
     299    } 
    286300  } 
    287301