Added system console & improved error handling

This commit is contained in:
Igor Malinovskiy
2014-02-19 12:17:07 +02:00
parent fd4969baff
commit 45edef84db
14 changed files with 625 additions and 486 deletions
+35 -31
View File
@@ -10,7 +10,7 @@
<x>0</x>
<y>0</y>
<width>341</width>
<height>305</height>
<height>306</height>
</rect>
</property>
<property name="minimumSize">
@@ -121,13 +121,16 @@
<item row="3" column="1">
<widget class="QLineEdit" name="sshUser"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Remote host</string>
<string>User</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="sshHost"/>
</item>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="useSshTunnel">
<property name="text">
@@ -135,9 +138,6 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="sshHost"/>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="sshPort">
<property name="minimum">
@@ -151,35 +151,40 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="sshPass">
<property name="inputMask">
<string/>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Remote host</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<item row="4" column="1">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Password</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>User</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="showPasswordCheckbox">
<property name="text">
<string>Show password</string>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLineEdit" name="sshPass">
<property name="inputMask">
<string/>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showPasswordCheckbox">
<property name="text">
<string>Show password</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
@@ -328,7 +333,6 @@
<tabstop>sshHost</tabstop>
<tabstop>sshPort</tabstop>
<tabstop>sshUser</tabstop>
<tabstop>sshPass</tabstop>
<tabstop>tabs</tabstop>
</tabstops>
<resources>
+496 -441
View File
@@ -8,7 +8,7 @@
<x>0</x>
<y>0</y>
<width>1036</width>
<height>618</height>
<height>671</height>
</rect>
</property>
<property name="sizePolicy">
@@ -59,9 +59,6 @@
<enum>Qt::LeftToRight</enum>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<property name="leftMargin">
<number>3</number>
</property>
@@ -72,60 +69,67 @@
<number>3</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>3</number>
</property>
<property name="horizontalSpacing">
<number>5</number>
</property>
<property name="verticalSpacing">
<number>0</number>
<property name="spacing">
<number>3</number>
</property>
<item row="0" column="0">
<widget class="QSplitter" name="splitter">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="QSplitter" name="splitter_2">
<property name="lineWidth">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Vertical</enum>
</property>
<property name="opaqueResize">
<bool>true</bool>
<property name="handleWidth">
<number>1</number>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>2</number>
</property>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLineEdit" name="leKeySearchPattern">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="toolTip">
<string>&lt;p&gt;&lt;b&gt;Key search supports regular expressions:&lt;/b&gt;&lt;/p&gt;
<widget class="QSplitter" name="splitter">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="opaqueResize">
<bool>true</bool>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>2</number>
</property>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLineEdit" name="leKeySearchPattern">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="toolTip">
<string>&lt;p&gt;&lt;b&gt;Key search supports regular expressions:&lt;/b&gt;&lt;/p&gt;
&lt;pre&gt;
. Any character except newline.
@@ -152,370 +156,370 @@ aa|bb Either aa or bb.
(?!expr) Not followed by expr.
&lt;/pre&gt;
</string>
</property>
<property name="inputMask">
<string/>
</property>
<property name="placeholderText">
<string>key search...</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="pbFindFilter">
<property name="minimumSize">
<size>
<width>35</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>25</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="toolTip">
<string>Apply filter</string>
</property>
<property name="text">
<string>Find</string>
</property>
<property name="icon">
<iconset resource="../Resources/demo.qrc">
<normaloff>:/images/ok.png</normaloff>:/images/ok.png</iconset>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="pbClearFilter">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>35</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>25</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="toolTip">
<string>Reset filter</string>
</property>
<property name="text">
<string>Clear</string>
</property>
<property name="icon">
<iconset resource="../Resources/demo.qrc">
<normaloff>:/images/clear.png</normaloff>:/images/clear.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="ConnectionTreeView" name="serversTreeView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>8000</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">font-family: monospaced;</string>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="headerHidden">
<bool>true</bool>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<attribute name="headerCascadingSectionResizes">
<bool>true</bool>
</attribute>
<attribute name="headerDefaultSectionSize">
<number>300</number>
</attribute>
<attribute name="headerStretchLastSection">
<bool>false</bool>
</attribute>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QToolButton" name="pbImportConnections">
<property name="minimumSize">
<size>
<width>145</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>145</width>
<height>35</height>
</size>
</property>
<property name="baseSize">
<size>
<width>145</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>Manage Connections</string>
</property>
<property name="icon">
<iconset resource="../Resources/demo.qrc">
<normaloff>:/images/menu.png</normaloff>:/images/menu.png</iconset>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pbAddServer">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>135</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>16777215</height>
</size>
</property>
<property name="baseSize">
<size>
<width>135</width>
<height>35</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="styleSheet">
<string notr="true">padding-left: 50px;
</string>
</property>
<property name="text">
<string>Add New Connection</string>
</property>
<property name="icon">
<iconset resource="../Resources/demo.qrc">
<normaloff>:/images/add.png</normaloff>:/images/add.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="MainTabsWidget" name="tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>580</width>
<height>0</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="tabPosition">
<enum>QTabWidget::North</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="elideMode">
<enum>Qt::ElideNone</enum>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
</property>
<property name="documentMode">
<bool>false</bool>
</property>
<property name="tabsClosable">
<bool>true</bool>
</property>
<property name="movable">
<bool>true</bool>
</property>
<widget class="BaseTab" name="rdmTab">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>2</horstretch>
<verstretch>2</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>50000</width>
<height>16777215</height>
</size>
</property>
<attribute name="icon">
<iconset resource="../Resources/demo.qrc">
<normaloff>:/images/redisIcon.png</normaloff>:/images/redisIcon.png</iconset>
</attribute>
<attribute name="title">
<string>Redis Desktop Manager</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<item row="0" column="0">
<widget class="QWidget" name="applicationIntroWidget" native="true">
</property>
<property name="inputMask">
<string/>
</property>
<property name="placeholderText">
<string>key search...</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="pbFindFilter">
<property name="minimumSize">
<size>
<width>35</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>25</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="toolTip">
<string>Apply filter</string>
</property>
<property name="text">
<string>Find</string>
</property>
<property name="icon">
<iconset resource="../Resources/demo.qrc">
<normaloff>:/images/ok.png</normaloff>:/images/ok.png</iconset>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="pbClearFilter">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>35</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>25</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="toolTip">
<string>Reset filter</string>
</property>
<property name="text">
<string>Clear</string>
</property>
<property name="icon">
<iconset resource="../Resources/demo.qrc">
<normaloff>:/images/clear.png</normaloff>:/images/clear.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="ConnectionTreeView" name="serversTreeView">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>570</width>
<height>255</height>
<width>300</width>
<height>0</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="applicationInfoLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>190</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>190</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>190</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;
<property name="maximumSize">
<size>
<width>8000</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">font-family: monospaced;</string>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="headerHidden">
<bool>true</bool>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<attribute name="headerCascadingSectionResizes">
<bool>true</bool>
</attribute>
<attribute name="headerDefaultSectionSize">
<number>300</number>
</attribute>
<attribute name="headerStretchLastSection">
<bool>false</bool>
</attribute>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QToolButton" name="pbImportConnections">
<property name="minimumSize">
<size>
<width>145</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>145</width>
<height>35</height>
</size>
</property>
<property name="baseSize">
<size>
<width>145</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>Manage Connections</string>
</property>
<property name="icon">
<iconset resource="../Resources/demo.qrc">
<normaloff>:/images/menu.png</normaloff>:/images/menu.png</iconset>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pbAddServer">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>135</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>16777215</height>
</size>
</property>
<property name="baseSize">
<size>
<width>135</width>
<height>35</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="styleSheet">
<string notr="true">padding-left: 50px;
</string>
</property>
<property name="text">
<string>Add New Connection</string>
</property>
<property name="icon">
<iconset resource="../Resources/demo.qrc">
<normaloff>:/images/add.png</normaloff>:/images/add.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="MainTabsWidget" name="tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>580</width>
<height>0</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="tabPosition">
<enum>QTabWidget::North</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="elideMode">
<enum>Qt::ElideNone</enum>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
</property>
<property name="documentMode">
<bool>false</bool>
</property>
<property name="tabsClosable">
<bool>true</bool>
</property>
<property name="movable">
<bool>true</bool>
</property>
<widget class="BaseTab" name="rdmTab">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>2</horstretch>
<verstretch>2</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>50000</width>
<height>16777215</height>
</size>
</property>
<attribute name="icon">
<iconset resource="../Resources/demo.qrc">
<normaloff>:/images/redisIcon.png</normaloff>:/images/redisIcon.png</iconset>
</attribute>
<attribute name="title">
<string>Redis Desktop Manager</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<item row="0" column="0">
<widget class="QWidget" name="applicationIntroWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>570</width>
<height>255</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="applicationInfoLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>190</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>190</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>190</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;
&lt;style&gt;a {color: darkblue; text-decoration: none}&lt;/style&gt;
&lt;body style=&quot;width:100%;&quot;&gt;&lt;div style=&quot;font-size:20pt; padding-top:10px;&quot;&gt;&lt;img style=&quot;float:left;&quot; src=&quot;:/images/logo.png&quot;/&gt;&lt;div style=&quot; font-size:24pt; margin-left: 100px; margin-top:2px; display: inline-block; padding-left:50px;&quot;&gt;Redis Desktop Manager&lt;/div&gt;&lt;div style=&quot;margin-left: 100px; display: inline-block; padding-left:53px; font-size: 11px; line-height: 21px&quot;&gt;&lt;b&gt;Cross-platform GUI application for managing Redis.&lt;/b&gt; &lt;br /&gt;&lt;b&gt;Version&lt;/b&gt; %VERSION% &amp;nbsp;&amp;nbsp;&amp;nbsp; Developed by - &lt;a href=&quot;http://glide.name/?rdm&quot;&gt;Igor Malinovskiy&lt;/a&gt; &lt;/div&gt;
@@ -536,43 +540,94 @@ aa|bb Either aa or bb.
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignVCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignVCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
<widget class="QPlainTextEdit" name="systemConsole">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>150</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>150</height>
</size>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="documentTitle">
<string>System console</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
<property name="maximumBlockCount">
<number>100000</number>
</property>
</widget>
</widget>
</item>
</layout>
@@ -36,6 +36,7 @@ private:
void initContextMenus();
void initUpdater();
void initFilter();
void initSystemConsole();
private slots:
void OnAddConnectionClick();
@@ -54,7 +55,9 @@ private:
void OnServerInfoOpen();
void OnConsoleOpen();
void OnError(QString);
void OnLogMessage(QString);
void OnUIUnlock();
void OnStatusMessage(QString);
void OnKeyOpenInNewTab();
void OnConsoleStateChanged();
};
@@ -30,6 +30,7 @@ signals:
void loadDatabasesList();
void dbListLoaded(RedisConnectionAbstract::RedisDatabases);
void error(QString);
void log(QString);
void operationProgress(int percents, QObject *);
protected:
@@ -62,6 +62,7 @@ signals:
void operationProgress(int percents, QObject *);
void databesesLoaded(RedisConnectionAbstract::RedisDatabases);
void errorOccurred(QString);
void log(QString);
protected:
bool connected;
@@ -30,6 +30,8 @@ public:
bool isErrorMessage() const;
QString toString();
private:
QByteArray responseSource;
@@ -25,6 +25,7 @@ MainWin::MainWin(QWidget *parent)
initFormButtons();
initUpdater();
initFilter();
initSystemConsole();
qRegisterMetaType<RedisConnectionAbstract::RedisDatabases>("RedisConnectionAbstract::RedisDatabases");
qRegisterMetaType<Command>("Command");
@@ -90,6 +91,21 @@ void MainWin::initFilter()
connect(ui.pbClearFilter, SIGNAL(clicked()), SLOT(OnClearFilter()));
}
void MainWin::initSystemConsole()
{
QPushButton * systemConsoleActivator = new QPushButton( QIcon(":/images/terminal.png"), "System console" );
connect(systemConsoleActivator, SIGNAL(clicked()), this, SLOT(OnConsoleStateChanged()));
ui.systemConsole->hide();
ui.statusBar->addPermanentWidget(systemConsoleActivator);
}
void MainWin::OnConsoleStateChanged()
{
ui.systemConsole->setVisible(!ui.systemConsole->isVisible());
}
QString MainWin::getConfigPath(const QString& configFile)
{
/*
@@ -390,6 +406,11 @@ void MainWin::OnError(QString msg)
QMessageBox::warning(this, "Error", msg);
}
void MainWin::OnLogMessage(QString message)
{
ui.systemConsole->appendPlainText(QString("[%1] %2").arg(QTime::currentTime().toString()).arg(message));
}
void MainWin::OnUIUnlock()
{
treeViewUILocked = false;
@@ -29,6 +29,7 @@ void ConnectionBridge::initWorker()
this, SIGNAL(dbListLoaded(RedisConnectionAbstract::RedisDatabases)));
connect(worker, SIGNAL(errorOccurred(QString)),this, SIGNAL(error(QString)));
connect(worker, SIGNAL(log(QString)),this, SIGNAL(log(QString)));
connect(worker, SIGNAL(operationProgress(int, QObject *)),this, SIGNAL(operationProgress(int, QObject *)));
connect(workerThread, SIGNAL(finished()) , worker, SLOT(disconnect()));
@@ -32,15 +32,27 @@ bool RedisConnection::connect()
socket->connectToHost(config.host, config.port);
if (socket->waitForConnected(config.connectionTimeout))
{
connected = true;
{
if (config.useAuth()) {
execute(QString("AUTH %1").arg(config.auth));
}
connected = (execute("PING") == "PONG");
if (!connected)
emit errorOccurred("Redis server require password or password invalid");
} else {
connected = false;
}
emit errorOccurred("Connection timeout");
}
if (connected) {
emit log(QString("%1 > connected").arg(config.name));
} else {
emit log(QString("%1 > connection failed").arg(config.name));
disconnect();
}
return connected;
}
@@ -71,6 +83,8 @@ QVariant RedisConnection::execute(QString command)
socket->write(cmd);
socket->flush();
emit log(QString("%1 > [execute] %2").arg(config.name).arg(command));
if (!socket->waitForReadyRead(config.executeTimeout)) {
QAbstractSocket::SocketError error = socket->error();
@@ -102,30 +116,36 @@ QVariant RedisConnection::execute(QString command)
if (!socket->waitForReadyRead(config.executeTimeout))
{
emit log(QString("%1 > [execute] %2 -> response partially received. Execution timeout").arg(config.name).arg(command));
break;
}
}
}
emit log(
QString("%1 > [execute] %2 -> response received: \n %3")
.arg(config.name)
.arg(command)
.arg(response.toString()));
return response.getValue();
}
void RedisConnection::runCommand(const Command &command)
{
if (command.hasDbIndex()) {
selectDb(command.getDbIndex());
}
emit log(QString("%1 > [runCommand] %2").arg(config.name).arg(command.getRawString()));
if (command.isEmpty()
|| (command.hasDbIndex() && !selectDb(command.getDbIndex())) ) {
return sendResponse();
}
resp.clear();
commandRunning = true;
runningCommand = command;
executionTimer->start(config.executeTimeout);
if (command.isEmpty()) {
return sendResponse();
}
executionTimer->start(config.executeTimeout);
// Send command
QByteArray cmd = command.getByteRepresentation();
@@ -135,6 +135,8 @@ void RedisConnectionAbstract::sendResponse()
emit responseResived(resp.getValue(), runningCommand.getOwner());
}
emit log(QString("%1 > [runCommand] %2 -> response recieved").arg(config.name).arg(runningCommand.getRawString()));
commandRunning = false;
processCommandQueue();
@@ -60,6 +60,7 @@ bool RedisConnectionOverSsh::connect()
if (socket == NULL) {
socketConnected = false;
emit errorOccurred(QString("SSH connection established, but redis connection failed"));
return socketConnected;
}
@@ -70,7 +71,7 @@ bool RedisConnectionOverSsh::connect()
if (!socketConnected && !syncTimer->isActive()) {
socketConnected = false;
emit errorOccurred(QString("SSH connection established, but redis connection error occurred"));
emit errorOccurred(QString("SSH connection established, but redis connection failed"));
return socketConnected;
}
@@ -78,6 +79,16 @@ bool RedisConnectionOverSsh::connect()
execute(QString("AUTH %1").arg(config.auth));
}
connected = (execute("PING") == "PONG");
if (connected) {
emit log(QString("%1 > connected").arg(config.name));
} else {
emit errorOccurred("Redis server require password or password invalid");
emit log(QString("%1 > connection failed").arg(config.name));
disconnect();
}
return socketConnected;
}
@@ -213,6 +224,8 @@ QVariant RedisConnectionOverSsh::execute(QString command)
socket->write(cString, byteArray.size());
emit log(QString("%1 > [execute] %2").arg(config.name).arg(command));
//wait for ready read
syncTimer->start(config.executeTimeout);
syncLoop->exec();
@@ -260,16 +273,26 @@ QVariant RedisConnectionOverSsh::execute(QString command)
continue;
}
emit log(QString("%1 > [execute] %2 -> response partially received. Execution timeout").arg(config.name).arg(command));
break;
}
}
emit log(
QString("%1 > [execute] %2 -> response received: \n %3")
.arg(config.name)
.arg(command)
.arg(response.toString()));
return response.getValue();
}
void RedisConnectionOverSsh::runCommand(const Command &command)
{
emit log(QString("%1 > [runCommand] %2").arg(config.name).arg(command.getRawString()));
if (command.isEmpty()
|| (command.hasDbIndex() && !selectDb(command.getDbIndex())) ) {
return sendResponse();
@@ -34,6 +34,7 @@ void RedisConnectionsManager::AddConnection(ConnectionBridge * c)
QObject::connect(item, SIGNAL(databasesLoaded()), this, SLOT(updateFilter()));
MainWin * errorViewForm = (MainWin *) parent();
QObject::connect(item, SIGNAL(error(QString)), errorViewForm, SLOT(OnError(QString)));
QObject::connect(c, SIGNAL(log(QString)), errorViewForm, SLOT(OnLogMessage(QString)));
QObject::connect(item, SIGNAL(unlockUI()), errorViewForm, SLOT(OnUIUnlock()));
QObject::connect(item, SIGNAL(statusMessage(QString)), errorViewForm, SLOT(OnStatusMessage(QString)));
@@ -42,6 +42,11 @@ void Response::appendToSource(QByteArray& src)
responseSource.append(src);
}
QString Response::toString()
{
return responseSource.left(1500);
}
QVariant Response::getValue()
{
if (responseSource.isEmpty()) {
+1 -1
View File
@@ -1,3 +1,3 @@
#ifndef RDM_VERSION
#define RDM_VERSION "0.7.5"
#define RDM_VERSION "0.7.6"
#endif // !RDM_VERSION