Changeset 6169 for trunk/qt-gui
- Timestamp:
- 04/23/08 04:30:09 (7 months ago)
- Location:
- trunk/qt-gui/src
- Files:
-
- 4 modified
-
gui-defines.h (modified) (1 diff)
-
licqgui.cpp (modified) (7 diffs)
-
mainwin.cpp (modified) (3 diffs)
-
skinbrowser.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt-gui/src/gui-defines.h
r5944 r6169 21 21 #define GUIDEFINES_H 22 22 23 #ifdef USE_KDE 24 # define PLUGIN_NAME "kde-gui" 25 #else 26 # define PLUGIN_NAME "qt-gui" 27 #endif 28 23 29 #define QTGUI_DIR "qt-gui/" 24 30 #define EMOTICONS_DIR "emoticons/" 31 #define QTGUI_CONFIGFILE "licq_qt-gui.conf" 25 32 26 33 #define NUM_MSG_PER_HISTORY 40 -
trunk/qt-gui/src/licqgui.cpp
r5943 r6169 36 36 #include <unistd.h> // for getopt 37 37 38 #include "gui-defines.h" 38 39 #include "mainwin.h" 39 40 #include "sigman.h" … … 48 49 const char *LP_Usage(void) 49 50 { 50 #ifdef USE_KDE 51 static const char usage[] = 52 "Usage: Licq [options] -p kde-gui -- [-h] [-s skinname] [-i iconpack] [-e extendediconpack] [-g gui style]\n" 53 " -h : this help screen\n" 54 " -s : set the skin to use (must be in {base dir}/qt-gui/skin.skinname)\n" 55 " -i : set the icons to use (must be in {base dir}/qt-gui/icons.iconpack)\n" 56 " -e : set the extended icons to use (must be in [base dir]/qt-gui/extended.icons.iconpack)\n" 57 " -g : set the gui style (MOTIF / WINDOWS / MAC / CDE / GTK / SGI / LCD), ignored by KDE support\n" 58 " -d : start hidden (dock icon only)\n" 59 " -D : disable dock icon for this session (does not affect dock icon settings)"; 60 #else 61 static const char usage[] = 62 "Usage: Licq [options] -p qt-gui -- [-h] [-s skinname] [-i iconpack] [-e extendediconpack] [-g gui style]\n" 63 " -h : this help screen\n" 64 " -s : set the skin to use (must be in {base dir}/qt-gui/skin.skinname)\n" 65 " -i : set the icons to use (must be in {base dir}/qt-gui/icons.iconpack)\n" 66 " -e : set the extended icons to use (must be in [base dir]/qt-gui/extended.icons.iconpack)\n" 67 " -g : set the gui style (MOTIF / WINDOWS / MAC / CDE / GTK / SGI / LCD), ignored by KDE support\n" 68 " -d : start hidden (dock icon only)\n" 69 " -D : disable dock icon for this session (does not affect dock icon settings)"; 70 #endif 71 72 return usage; 51 static const QString usage = QString( 52 "Usage: Licq [options] -p %1 -- [-h] [-s skinname] [-i iconpack] [-e extendediconpack]" 53 #ifndef USE_KDE 54 " [-g gui style]" 55 #endif 56 "\n" 57 " -h : this help screen\n" 58 " -s : set the skin to use (must be in %2%3skin.skinname)\n" 59 " -i : set the icons to use (must be in %4%5icons.iconpack)\n" 60 " -e : set the extended icons to use (must be in %6%7extended.icons.iconpack)\n" 61 #ifndef USE_KDE 62 " -g : set the gui style (%8 or 'default' to follow global Qt settings)\n" 63 #endif 64 " -d : start hidden (dock icon only)\n" 65 " -D : disable dock icon for this session (does not affect dock icon settings)" 66 ) 67 .arg(PLUGIN_NAME) 68 .arg(BASE_DIR) 69 .arg(QTGUI_DIR) 70 .arg(BASE_DIR) 71 .arg(QTGUI_DIR) 72 .arg(BASE_DIR) 73 .arg(QTGUI_DIR) 74 #ifndef USE_KDE 75 .arg(QStyleFactory::keys().join(", ")) 76 #endif 77 ; 78 79 return usage.latin1(); 73 80 } 74 81 … … 86 93 const char *LP_ConfigFile(void) 87 94 { 88 return "licq_qt-gui.conf";95 return QTGUI_CONFIGFILE; 89 96 } 90 97 … … 216 223 char iconsName[32] = ""; 217 224 char extendedIconsName[32] = ""; 225 #ifndef USE_KDE 218 226 char styleName[32] = ""; 227 #endif 219 228 bool bStartHidden = false; 220 229 … … 226 235 cmdLineParams += QString(argv[0]); 227 236 cmdLineParams += QString("-p"); 228 #ifdef USE_KDE 229 cmdLineParams += QString("kde-gui"); 230 #else 231 cmdLineParams += QString("qt-gui"); 232 #endif 237 cmdLineParams += QString(PLUGIN_NAME); 233 238 cmdLineParams += QString("--"); 234 239 for(int i=1;i<argc;i++) … … 256 261 extendedIconsName[sizeof(extendedIconsName) - 1] = '\0'; 257 262 break; 263 #ifndef USE_KDE 258 264 case 'g': // gui style 259 265 strncpy(styleName, optarg, sizeof(styleName)); 260 266 styleName[sizeof(styleName) - 1] = '\0'; 261 267 break; 268 #endif 262 269 case 'd': // dock icon 263 270 if (!m_bDisableDockIcon) … … 310 317 gLog.Info("%sAttempting to load %s Qt-GUI translation.\n", L_INITxSTR, 311 318 GetLocale()); 312 QString str;313 str.sprintf("%sqt-gui/locale/%s", SHARE_DIR, GetLocale());314 319 QTranslator *trans = new QTranslator(this); 315 trans->load( str);320 trans->load(QString("%1" QTGUI_DIR "locale/%2").arg(SHARE_DIR).arg(GetLocale())); 316 321 installTranslator(trans); 317 322 } -
trunk/qt-gui/src/mainwin.cpp
r5779 r6169 380 380 gLog.Info("%sQt GUI configuration.\n", L_INITxSTR); 381 381 #endif 382 snprintf(szTemp, MAX_FILENAME_LEN, "%s/ licq_qt-gui.conf", BASE_DIR);382 snprintf(szTemp, MAX_FILENAME_LEN, "%s/" QTGUI_CONFIGFILE , BASE_DIR); 383 383 szTemp[MAX_FILENAME_LEN - 1] = '\0'; 384 384 CIniFile licqConf; … … 1195 1195 // save window position and size 1196 1196 char buf[MAX_FILENAME_LEN]; 1197 snprintf(buf, MAX_FILENAME_LEN, "%s/ licq_qt-gui.conf", BASE_DIR);1197 snprintf(buf, MAX_FILENAME_LEN, "%s/" QTGUI_CONFIGFILE, BASE_DIR); 1198 1198 buf[MAX_FILENAME_LEN - 1] = '\0'; 1199 1199 CIniFile licqConf(INI_FxALLOWxCREATE | INI_FxWARN); … … 3427 3427 // Save all our options 3428 3428 char filename[MAX_FILENAME_LEN]; 3429 snprintf(filename, MAX_FILENAME_LEN, "%s/ licq_qt-gui.conf", BASE_DIR);3429 snprintf(filename, MAX_FILENAME_LEN, "%s/" QTGUI_CONFIGFILE, BASE_DIR); 3430 3430 filename[MAX_FILENAME_LEN - 1] = '\0'; 3431 3431 CIniFile licqConf(INI_FxERROR | INI_FxALLOWxCREATE); -
trunk/qt-gui/src/skinbrowser.cpp
r5514 r6169 33 33 #include "editfile.h" 34 34 #include "ewidgets.h" 35 #include "gui-defines.h" 35 36 #include "licq_log.h" 36 37 #include "licq_constants.h" … … 177 178 if (!dSkins.count() && !dSkinsUser.count()) 178 179 { 179 gLog.Error("%sError reading qt-guidirectory %s.\n", L_ERRORxSTR, szDir.latin1());180 gLog.Error("%sError reading " PLUGIN_NAME " directory %s.\n", L_ERRORxSTR, szDir.latin1()); 180 181 cmbSkin->insertItem(tr("Error")); 181 182 cmbSkin->setEnabled(false); … … 214 215 if (!dIcons.count() && !dIconsUser.count()) 215 216 { 216 gLog.Error("%sError reading qt-guidirectory %s.\n", L_ERRORxSTR, szDir.latin1());217 gLog.Error("%sError reading " PLUGIN_NAME " directory %s.\n", L_ERRORxSTR, szDir.latin1()); 217 218 cmbIcon->insertItem(tr("Error")); 218 219 cmbIcon->setEnabled(false); … … 279 280 if (!dExtendedIcons.count() && !dExtendedIconsUser.count()) 280 281 { 281 gLog.Error("%sError reading qt-guidirectory %s.\n", L_ERRORxSTR, szDir.latin1());282 gLog.Error("%sError reading " PLUGIN_NAME " directory %s.\n", L_ERRORxSTR, szDir.latin1()); 282 283 cmbExtIcon->insertItem(tr("Error")); 283 284 cmbExtIcon->setEnabled(false); … … 419 420 { 420 421 if (!cmbSkin->currentText()) return; 421 QString f; 422 f.sprintf("%s/qt-gui/skin.%s/%s.skin", BASE_DIR, 423 QFile::encodeName(cmbSkin->currentText()).data(), 424 QFile::encodeName(cmbSkin->currentText()).data()); 425 if (!QFile(f).exists()) 426 f.sprintf("%sqt-gui/skin.%s/%s.skin", SHARE_DIR, 427 QFile::encodeName(cmbSkin->currentText()).data(), 428 QFile::encodeName(cmbSkin->currentText()).data()); 422 QString skinName = QFile::encodeName(cmbSkin->currentText()); 423 QString f = QTGUI_DIR "skin." + skinName + "/" + skinName + ".skin"; 424 QString baseF = QString(BASE_DIR) + "/" + f; 425 if (QFile(baseF).exists()) 426 f = baseF; 427 else 428 f = SHARE_DIR + f; 429 429 (void) new EditFileDlg(f); 430 430 }
