Skip to content

Commit

Permalink
Merge pull request #94 from code-mancers/new-add-icons
Browse files Browse the repository at this point in the history
New add icons
  • Loading branch information
Hemant Kumar committed Sep 20, 2014
2 parents 0c333ea + af09d35 commit 71e79c9
Show file tree
Hide file tree
Showing 25 changed files with 135 additions and 32 deletions.
5 changes: 5 additions & 0 deletions rbkit-app/appicon.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>rbkit.icns</file>
</qresource>
</RCC>
3 changes: 3 additions & 0 deletions rbkit-app/main.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#include "rbkitmainwindow.h"
#include <QApplication>
#include <QIcon>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QApplication::setWindowIcon(QIcon(":/rbkit.icns"));

RbkitMainWindow mainWindow;
mainWindow.setWindowIcon(QIcon(":/rbkit.icns"));
app.processEvents();
mainWindow.show();

Expand Down
3 changes: 3 additions & 0 deletions rbkit-app/rbkit-app.pro
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ include($$RC_ROOT_SOURCE_DIR/common.pri)

# Include rbkit-charts via pri file
include($$RC_ROOT_SOURCE_DIR/rbkit-charts/rbcharts.pri)

RESOURCES += \
appicon.qrc
Binary file added rbkit-app/rbkit.icns
Binary file not shown.
Binary file added rbkit-lib/Comapre-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rbkit-lib/Comapre-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rbkit-lib/Comapre-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 50 additions & 29 deletions rbkit-lib/askhost.ui
Original file line number Diff line number Diff line change
Expand Up @@ -22,54 +22,75 @@
<property name="windowTitle">
<string>Enter address of your Ruby app</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="hostInfo">
<property name="text">
<string>Enter connection information for events</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="hostInfo">
<property name="text">
<string>Enter connection information for events</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="eventsSocket">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="eventsSocket">
<property name="text">
<string>tcp://127.0.0.1:5555</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>tcp://127.0.0.1:5555</string>
<string>Enter connection information for commands</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLineEdit" name="commandsSocket">
<property name="text">
<string>tcp://127.0.0.1:5556</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Enter connection information for commands</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="commandsSocket">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>178</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="hostSelectedButton">
<property name="text">
<string>tcp://127.0.0.1:5556</string>
<string>&amp;Ok</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="hostSelectedButton">
<property name="text">
<string>&amp;Ok</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
Expand Down
Binary file added rbkit-lib/connect-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rbkit-lib/connect-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rbkit-lib/connect-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rbkit-lib/disconnect-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rbkit-lib/disconnect-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rbkit-lib/disconnect-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions rbkit-lib/rbkit-lib.pro
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ FORMS += \
heapdumpform.ui \
memoryview.ui \
comapresnapshotform.ui

RESOURCES += \
tool_icons.qrc
11 changes: 11 additions & 0 deletions rbkit-lib/rbkitmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ RbkitMainWindow::RbkitMainWindow(QWidget *parent) :
QMainWindow(parent), connected(false), host(""),
ui(new Ui::RbkitMainWindow), currentIndex(0)
{
Q_INIT_RESOURCE(tool_icons);
RBKit::SqlConnectionPool::getInstance()->setupDatabase();
this->connected = false;
ui->setupUi(this);
setupToolbarStyle();

snapshotProgressTimer = new QTimer(this);

Expand Down Expand Up @@ -80,6 +82,11 @@ void RbkitMainWindow::askForServerInfo() {
}
}

void RbkitMainWindow::setupToolbarStyle()
{
ui->toolBar->setStyleSheet("QToolButton:pressed { background-color: rgb(160,160,160); border-style: inset; }");
}

QList<int> RbkitMainWindow::diffableSnapshotVersions()
{
QList<int> selectedSnapshots;
Expand Down Expand Up @@ -160,14 +167,18 @@ void RbkitMainWindow::setupSubscriber()
void RbkitMainWindow::disconnectedFromSocket()
{
ui->action_Connect->setText(tr("&Connect"));
ui->action_Connect->setIcon(QIcon(":/connect-32.png"));
this->connected = false;
ui->statusbar->showMessage("Not connected to any Ruby application");
emit disconnectSubscriber();
}


void RbkitMainWindow::connectedToSocket()
{
ui->action_Connect->setText(tr("&Disconnect"));
ui->action_Connect->setIcon(QIcon(":/disconnect-32.png"));
ui->statusbar->showMessage("Currently Profiling Ruby application");
this->connected = true;
}

Expand Down
3 changes: 2 additions & 1 deletion rbkit-lib/rbkitmainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ class RbkitMainWindow : public QMainWindow
QLabel *statusLabel;
QProgressBar *progressBar;
QTimer *snapshotProgressTimer;
bool connected;

void setupSubscriber();
void disconnectFromSocket();
void askForServerInfo();
void setupToolbarStyle();
QList<int> diffableSnapshotVersions();
bool connected;

public:
explicit RbkitMainWindow(QWidget *parent = 0);
Expand Down
41 changes: 39 additions & 2 deletions rbkit-lib/rbkitmainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<x>0</x>
<y>0</y>
<width>1100</width>
<height>24</height>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
Expand All @@ -67,18 +67,41 @@
<property name="windowTitle">
<string>toolBar</string>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="movable">
<bool>false</bool>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="floatable">
<bool>false</bool>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="separator"/>
<addaction name="action_Connect"/>
<addaction name="action_Trigger_GC"/>
<addaction name="actionHeap_Snapshot"/>
<addaction name="actionComapre_Heapsnapshots"/>
</widget>
<action name="action_Connect">
<property name="icon">
<iconset resource="tool_icons.qrc">
<normaloff>:/connect-32.png</normaloff>:/connect-32.png</iconset>
</property>
<property name="text">
<string>&amp;Connect</string>
</property>
Expand All @@ -94,11 +117,19 @@
</property>
</action>
<action name="action_Trigger_GC">
<property name="icon">
<iconset resource="tool_icons.qrc">
<normaloff>:/startgc-32.png</normaloff>:/startgc-32.png</iconset>
</property>
<property name="text">
<string>&amp;Start GC</string>
</property>
</action>
<action name="actionHeap_Snapshot">
<property name="icon">
<iconset resource="tool_icons.qrc">
<normaloff>:/snapshot-32.png</normaloff>:/snapshot-32.png</iconset>
</property>
<property name="text">
<string>Heap Snapshot</string>
</property>
Expand All @@ -107,6 +138,10 @@
</property>
</action>
<action name="actionComapre_Heapsnapshots">
<property name="icon">
<iconset resource="tool_icons.qrc">
<normaloff>:/Comapre-16.png</normaloff>:/Comapre-16.png</iconset>
</property>
<property name="text">
<string>Comapre Snapshots</string>
</property>
Expand All @@ -115,6 +150,8 @@
</property>
</action>
</widget>
<resources/>
<resources>
<include location="tool_icons.qrc"/>
</resources>
<connections/>
</ui>
Binary file added rbkit-lib/snapshot-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rbkit-lib/snapshot-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rbkit-lib/snapshot-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rbkit-lib/startgc-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rbkit-lib/startgc-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rbkit-lib/startgc-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions rbkit-lib/tool_icons.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<RCC>
<qresource prefix="/">
<file>connect-128.png</file>
<file>disconnect-128.png</file>
<file>snapshot-128.png</file>
<file>startgc-128.png</file>
<file>connect-48.png</file>
<file>disconnect-48.png</file>
<file>snapshot-48.png</file>
<file>startgc-48.png</file>
<file>connect-32.png</file>
<file>disconnect-32.png</file>
<file>snapshot-32.png</file>
<file>startgc-32.png</file>
<file>Comapre-16.png</file>
<file>Comapre-32.png</file>
<file>Comapre-48.png</file>
</qresource>
</RCC>

0 comments on commit 71e79c9

Please sign in to comment.