Skip to content

Commit 0f231c6

Browse files
committed
Merge branch 'console'
2 parents ecca35c + f3e864e commit 0f231c6

38 files changed

+1172
-578
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ before_script:
1313
script:
1414
- qmake -qt=qt5 -v
1515
- qmake -qt=qt5
16+
- make clean
1617
- make -s
1718
- cd ./../tests/
1819
- qmake
20+
- make clean
1921
- make -s
2022
- ./../bin/tests/tests -platform minimal -txt
2123
services:
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>serverInfoViewTab</class>
4+
<widget class="QWidget" name="serverInfoViewTab">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>417</width>
10+
<height>309</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>Form</string>
15+
</property>
16+
<layout class="QVBoxLayout" name="verticalLayout">
17+
<item>
18+
<widget class="QLabel" name="serverName">
19+
<property name="text">
20+
<string/>
21+
</property>
22+
</widget>
23+
</item>
24+
<item>
25+
<widget class="QListView" name="serverInfoView"/>
26+
</item>
27+
</layout>
28+
</widget>
29+
<resources/>
30+
<connections/>
31+
</ui>
-45.1 KB
Binary file not shown.

redis-desktop-manager/include/connection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class connection : public QDialog
1616

1717
private:
1818
Ui::connectionDialog ui;
19-
Main * mainForm;
19+
MainWin * mainForm;
2020
RedisServerItem * server;
2121

2222
bool inEditMode;

redis-desktop-manager/include/demo.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,26 @@
1313
class RedisKeyItem;
1414
class Updater;
1515

16-
class Main : public QMainWindow
16+
class MainWin : public QMainWindow
1717
{
1818
Q_OBJECT
1919

2020
public:
2121
RedisConnectionsManager * connections;
2222

23-
Main(QWidget *parent = 0);
24-
~Main();
23+
MainWin(QWidget *parent = 0);
24+
~MainWin();
2525
private:
2626
bool loadingInProgress;
2727
Ui::demoClass ui;
2828
Updater * updater;
2929

3030
void loadKeyTab(RedisKeyItem *);
31+
void addTab(QString&, QWidget*);
32+
33+
/** @return >=0 if exist **/
34+
int getTabIndex(QString&);
35+
3136
QString getConfigPath(const QString&);
3237

3338
void initFormButtons();
@@ -36,6 +41,8 @@ class Main : public QMainWindow
3641
void initUpdater();
3742
void initFilter();
3843

44+
QStandardItem * getSelectedItemInConnectionsTree();
45+
3946
private slots:
4047
void OnAddConnectionClick();
4148
void OnConnectionTreeClick(const QModelIndex & index);
@@ -48,6 +55,8 @@ class Main : public QMainWindow
4855
void OnImportConnectionsClick();
4956
void OnSetFilter();
5057
void OnClearFilter();
58+
void OnServerInfoOpen();
59+
void OnConsoleOpen();
5160
};
5261

5362
#endif // DEMO_H

redis-desktop-manager/include/models/items/RedisServerItem.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class RedisServerItem : public QStandardItem
1616
RedisServerItem(RedisConnectionAbstract * c);
1717

1818
bool loadDatabases();
19+
QStringList getInfo();
1920

2021
void reload();
2122
void unload();
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#pragma once
2+
3+
#include <QtCore>
4+
5+
class Command
6+
{
7+
public:
8+
/** @see http://redis.io/topics/protocol for more info **/
9+
static QString getFormatted(QString command);
10+
};
11+

redis-desktop-manager/include/redis/RedisConnectionAbstract.h

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,9 @@ class RedisConnectionAbstract
3434
void selectDb(int dbIndex);
3535

3636
QStringList getKeys(QString pattern = "*");
37+
3738
protected:
3839
bool connected;
39-
40-
enum ResponseType
41-
{
42-
Status, Error, Integer, Bulk, MultiBulk, Unknown
43-
};
44-
45-
/** @see http://redis.io/topics/protocol for more info **/
46-
QString prepareCommand(QString command);
47-
48-
QVariant parseResponse(QString response);
49-
50-
ResponseType getResponseType(QString r);
51-
52-
QString getStringResponse(QString response);
53-
54-
bool isFullResponseRecieved(QString r);
55-
bool isIntReplyValid(QString r);
56-
bool isBulkReplyValid(QString r);
57-
bool isMultiBulkReplyValid(QString r);
58-
bool waitForData(int ms);
5940

60-
int getSizeOfBulkReply(QString mb);
6141
};
6242

redis-desktop-manager/include/redis/RedisConnectionConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class RedisConnectionConfig
2626
static const int executeTimeout = 30000;
2727

2828
RedisConnectionConfig(const QString & host, const QString & name = "", const int port = DEFAULT_REDIS_PORT)
29-
: host(host), port(port), name(name), sshPort(DEFAULT_SSH_PORT)
29+
: name(name), host(host), port(port), sshPort(DEFAULT_SSH_PORT)
3030
{};
3131

3232
RedisConnectionConfig & operator = (RedisConnectionConfig & other)

redis-desktop-manager/include/redis/RedisConnectionOverSsh.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ class RedisConnectionOverSsh : public QObject, public RedisConnectionAbstract
3030
QTimer syncTimer;
3131
bool socketConnected;
3232

33+
bool waitForData(int ms);
34+
3335
protected slots:
3436
void OnSshConnectionError(QxtSshClient::Error);
3537
void OnSshConnected();
3638
void OnSocketReadyRead();
37-
void OnAuthRequired(QList<QxtSshClient::AuthenticationMethod>);
38-
3939
};
4040

0 commit comments

Comments
 (0)