update zlib_compress.pro, add "reset factory settings" button to

settings menu
This commit is contained in:
doitux
2012-01-05 23:47:59 +00:00
parent 3a659dd5d5
commit 87b7242d6b
5 changed files with 136 additions and 2 deletions
+1
View File
@@ -53,6 +53,7 @@
<file>emblem-important-64.png</file>
<file>dialog-information.png</file>
<file>view-statistics.png</file>
<file>document-revert.png</file>
</qresource>
<qresource prefix="/cflags">
<file>cflags/ad.png</file>
+111
View File
@@ -120,6 +120,15 @@
<normaloff>:/gfx/utilities-log-viewer.png</normaloff>:/gfx/utilities-log-viewer.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Factory Settings</string>
</property>
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/document-revert.png</normaloff>:/gfx/document-revert.png</iconset>
</property>
</item>
</widget>
</item>
<item>
@@ -3612,6 +3621,108 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<widget class="QWidget" name="page_9">
<layout class="QGridLayout" name="gridLayout_22">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_44">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Factory Settings</string>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>269</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_resetSettings">
<property name="minimumSize">
<size>
<width>300</width>
<height>60</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Reset all settings to default ...</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="5" column="1">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>269</width>
<height>292</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="2">
<widget class="Line" name="line_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
@@ -109,6 +109,7 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva
connect( pushButton_Opponent9Avatar, SIGNAL( clicked() ), this, SLOT( setAvatarFile9()) );
connect( pushButton_editManualBlindsOrder, SIGNAL( clicked() ), this, SLOT( callManualBlindsOrderDialog()) );
connect( pushButton_netEditManualBlindsOrder, SIGNAL( clicked() ), this, SLOT( callNetManualBlindsOrderDialog()) );
connect( pushButton_resetSettings, SIGNAL(clicked()), this, SLOT(resetSettings()));
connect( checkBox_UseInternetGamePassword, SIGNAL( toggled(bool) ), this, SLOT( clearInternetGamePassword(bool)) );
@@ -1366,3 +1367,15 @@ void settingsDialogImpl::showLogFilePreview()
cursor.movePosition(QTextCursor::Start);
textBrowser_logPreview->setTextCursor(cursor);
}
void settingsDialogImpl::resetSettings()
{
int ret = QMessageBox::warning(this, tr("PokerTH - Settings"),
tr("Attention: this will delete all your personal settings!\n"
"Do you really want to reset factory settings?"),
QMessageBox::Yes | QMessageBox::No);
if(ret == QMessageBox::Yes)
{
//TODO delete config.xml and directly close PokerTH
}
}
@@ -114,6 +114,7 @@ public slots:
void exportLogToTxt();
void saveLogFileAs();
void showLogFilePreview();
void resetSettings();
private:
+10 -2
View File
@@ -15,6 +15,7 @@ TARGET = bin/zlib_compress
MOC_DIR = mocs
OBJECTS_DIR = obj
DEFINES += PREFIX=\"$${PREFIX}\"
DEFINES += BOOST_FILESYSTEM_DEPRECATED
QT -= core gui
INCLUDEPATH += . \
@@ -50,6 +51,7 @@ unix : !mac {
LIB_DIRS = $${PREFIX}/lib $${PREFIX}/lib64
BOOST_FS = boost_filesystem boost_filesystem-mt
BOOST_IOSTREAMS = boost_iostreams boost_iostreams-mt
BOOST_SYSTEM = boost_system boost_system-mt
for(dir, LIB_DIRS) {
exists($$dir) {
@@ -65,10 +67,16 @@ unix : !mac {
BOOST_IOSTREAMS = -l$$lib
}
}
for(lib, BOOST_SYSTEM) {
exists($${dir}/lib$${lib}.so*) {
message("Found $$lib")
BOOST_SYSTEM = -l$$lib
}
}
}
}
BOOST_LIBS = $$BOOST_FS $$BOOST_IOSTREAMS
!count(BOOST_LIBS, 2) {
BOOST_LIBS = $$BOOST_FS $$BOOST_IOSTREAMS $$BOOST_SYSTEM
!count(BOOST_LIBS, 3) {
error("could not locate required library: \
libboost (version >= 1.34.1) --> http://www.boost.org/")
}